diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-03 08:26:33 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:33:03 +0000 |
commit | 3a2c5a6fa2e0081c28d5f2f43e1d9a79d093ea37 (patch) | |
tree | f596b84a7295cd8421fcee447a10e2c082b94c72 /bitbake/lib/hashserv/client.py | |
parent | 8cfb94c06cdfe3e6f0ec1ce0154951108bc3df94 (diff) | |
download | poky-3a2c5a6fa2e0081c28d5f2f43e1d9a79d093ea37.tar.gz |
bitbake: hashserv: Add db-usage API
Adds an API to query the server for the usage of the database (e.g. how
many rows are present in each table)
(Bitbake rev: c9c1224447e147e0de92953bc85cea75670b898c)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/hashserv/client.py')
-rw-r--r-- | bitbake/lib/hashserv/client.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/client.py b/bitbake/lib/hashserv/client.py index 4457f8e50d..5e0a462b1c 100644 --- a/bitbake/lib/hashserv/client.py +++ b/bitbake/lib/hashserv/client.py | |||
@@ -186,6 +186,10 @@ class AsyncClient(bb.asyncrpc.AsyncClient): | |||
186 | self.saved_become_user = username | 186 | self.saved_become_user = username |
187 | return result | 187 | return result |
188 | 188 | ||
189 | async def get_db_usage(self): | ||
190 | await self._set_mode(self.MODE_NORMAL) | ||
191 | return (await self.invoke({"get-db-usage": {}}))["usage"] | ||
192 | |||
189 | 193 | ||
190 | class Client(bb.asyncrpc.Client): | 194 | class Client(bb.asyncrpc.Client): |
191 | def __init__(self, username=None, password=None): | 195 | def __init__(self, username=None, password=None): |
@@ -214,6 +218,7 @@ class Client(bb.asyncrpc.Client): | |||
214 | "new_user", | 218 | "new_user", |
215 | "delete_user", | 219 | "delete_user", |
216 | "become_user", | 220 | "become_user", |
221 | "get_db_usage", | ||
217 | ) | 222 | ) |
218 | 223 | ||
219 | def _get_async_client(self): | 224 | def _get_async_client(self): |