* Added block cache memory usage data source.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31947 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2008-2009, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ const DataSource* kSources[] = {
|
|||||||
new CPUCombinedUsageDataSource(),
|
new CPUCombinedUsageDataSource(),
|
||||||
new NetworkUsageDataSource(true),
|
new NetworkUsageDataSource(true),
|
||||||
new NetworkUsageDataSource(false),
|
new NetworkUsageDataSource(false),
|
||||||
|
new BlockCacheDataSource(),
|
||||||
new SemaphoresDataSource(),
|
new SemaphoresDataSource(),
|
||||||
new PortsDataSource(),
|
new PortsDataSource(),
|
||||||
new ThreadsDataSource(),
|
new ThreadsDataSource(),
|
||||||
@@ -450,6 +451,54 @@ SwapSpaceDataSource::Primary() const
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
BlockCacheDataSource::BlockCacheDataSource()
|
||||||
|
{
|
||||||
|
fColor = (rgb_color){0, 120, 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BlockCacheDataSource::~BlockCacheDataSource()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataSource*
|
||||||
|
BlockCacheDataSource::Copy() const
|
||||||
|
{
|
||||||
|
return new BlockCacheDataSource(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64
|
||||||
|
BlockCacheDataSource::NextValue(SystemInfo& info)
|
||||||
|
{
|
||||||
|
system_memory_info memoryInfo;
|
||||||
|
status_t status = get_system_info_etc(B_MEMORY_INFO, &memoryInfo,
|
||||||
|
sizeof(system_memory_info));
|
||||||
|
if (status != B_OK)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return memoryInfo.block_cache_memory;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char*
|
||||||
|
BlockCacheDataSource::Label() const
|
||||||
|
{
|
||||||
|
return "Block Cache Memory Usage";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char*
|
||||||
|
BlockCacheDataSource::ShortLabel() const
|
||||||
|
{
|
||||||
|
return "Block Cache";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
SemaphoresDataSource::SemaphoresDataSource()
|
SemaphoresDataSource::SemaphoresDataSource()
|
||||||
{
|
{
|
||||||
SystemInfo info;
|
SystemInfo info;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2008-2009, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef DATA_SOURCE_H
|
#ifndef DATA_SOURCE_H
|
||||||
@@ -115,6 +115,19 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class BlockCacheDataSource : public MemoryDataSource {
|
||||||
|
public:
|
||||||
|
BlockCacheDataSource();
|
||||||
|
virtual ~BlockCacheDataSource();
|
||||||
|
|
||||||
|
virtual DataSource* Copy() const;
|
||||||
|
|
||||||
|
virtual int64 NextValue(SystemInfo& info);
|
||||||
|
virtual const char* Label() const;
|
||||||
|
virtual const char* ShortLabel() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class SemaphoresDataSource : public DataSource {
|
class SemaphoresDataSource : public DataSource {
|
||||||
public:
|
public:
|
||||||
SemaphoresDataSource();
|
SemaphoresDataSource();
|
||||||
|
|||||||
Reference in New Issue
Block a user