Compare commits
2 Commits
nilmdb-1.6
...
nilmdb-1.6
Author | SHA1 | Date | |
---|---|---|---|
2317894355 | |||
539c92226c |
@@ -21,5 +21,8 @@ def cmd_info(self):
|
|||||||
printf("Server URL: %s\n", self.client.geturl())
|
printf("Server URL: %s\n", self.client.geturl())
|
||||||
dbinfo = self.client.dbinfo()
|
dbinfo = self.client.dbinfo()
|
||||||
printf("Server database path: %s\n", dbinfo["path"])
|
printf("Server database path: %s\n", dbinfo["path"])
|
||||||
printf("Server database size: %s\n", human_size(dbinfo["size"]))
|
for (desc, field) in [("used by NilmDB", "size"),
|
||||||
printf("Server database free space: %s\n", human_size(dbinfo["free"]))
|
("used by other", "other"),
|
||||||
|
("reserved", "reserved"),
|
||||||
|
("free", "free")]:
|
||||||
|
printf("Server disk space %s: %s\n", desc, human_size(dbinfo[field]))
|
||||||
|
@@ -19,8 +19,8 @@ from . import rocket
|
|||||||
|
|
||||||
# Up to 256 open file descriptors at any given time.
|
# Up to 256 open file descriptors at any given time.
|
||||||
# These variables are global so they can be used in the decorator arguments.
|
# These variables are global so they can be used in the decorator arguments.
|
||||||
table_cache_size = 16
|
table_cache_size = 32
|
||||||
fd_cache_size = 16
|
fd_cache_size = 8
|
||||||
|
|
||||||
@nilmdb.utils.must_close(wrap_verify = False)
|
@nilmdb.utils.must_close(wrap_verify = False)
|
||||||
class BulkData(object):
|
class BulkData(object):
|
||||||
|
@@ -176,7 +176,7 @@ class NilmDB(object):
|
|||||||
raise NilmDBError("start must precede end")
|
raise NilmDBError("start must precede end")
|
||||||
return (start, end)
|
return (start, end)
|
||||||
|
|
||||||
@nilmdb.utils.lru_cache(size = 16)
|
@nilmdb.utils.lru_cache(size = 64)
|
||||||
def _get_intervals(self, stream_id):
|
def _get_intervals(self, stream_id):
|
||||||
"""
|
"""
|
||||||
Return a mutable IntervalSet corresponding to the given stream ID.
|
Return a mutable IntervalSet corresponding to the given stream ID.
|
||||||
|
@@ -167,9 +167,13 @@ class Root(NilmApp):
|
|||||||
"""Return a dictionary with the database path,
|
"""Return a dictionary with the database path,
|
||||||
size of the database in bytes, and free disk space in bytes"""
|
size of the database in bytes, and free disk space in bytes"""
|
||||||
path = self.db.get_basepath()
|
path = self.db.get_basepath()
|
||||||
|
usage = psutil.disk_usage(path)
|
||||||
|
dbsize = nilmdb.utils.du(path)
|
||||||
return { "path": path,
|
return { "path": path,
|
||||||
"size": nilmdb.utils.du(path),
|
"size": dbsize,
|
||||||
"free": psutil.disk_usage(path).free }
|
"other": usage.used - dbsize,
|
||||||
|
"reserved": usage.total - usage.used - usage.free,
|
||||||
|
"free": usage.free }
|
||||||
|
|
||||||
class Stream(NilmApp):
|
class Stream(NilmApp):
|
||||||
"""Stream-specific operations"""
|
"""Stream-specific operations"""
|
||||||
|
@@ -245,8 +245,10 @@ class TestCmdline(object):
|
|||||||
self.contain("Client version: " + nilmdb.__version__)
|
self.contain("Client version: " + nilmdb.__version__)
|
||||||
self.contain("Server version: " + test_server.version)
|
self.contain("Server version: " + test_server.version)
|
||||||
self.contain("Server database path")
|
self.contain("Server database path")
|
||||||
self.contain("Server database size")
|
self.contain("Server disk space used by NilmDB")
|
||||||
self.contain("Server database free space")
|
self.contain("Server disk space used by other")
|
||||||
|
self.contain("Server disk space reserved")
|
||||||
|
self.contain("Server disk space free")
|
||||||
|
|
||||||
def test_04_createlist(self):
|
def test_04_createlist(self):
|
||||||
# Basic stream tests, like those in test_client.
|
# Basic stream tests, like those in test_client.
|
||||||
|
Reference in New Issue
Block a user