forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datastore: Add datastoreusage command
datastoreusage returns the total_bytes that are stored under a given {Key} or from root. {Key} is the entry point from which we begin to traverse the datastore. Changelog-Added: JSON-RPC: `datastoreusage`: returns the total bytes that are stored under a given key. Signed-off-by: Peter Neuroth <[email protected]>
- Loading branch information
1 parent
5aea5ff
commit aab948e
Showing
9 changed files
with
155 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ Rusty Russell <<[email protected]>> is mainly responsible. | |
SEE ALSO | ||
-------- | ||
|
||
lightning-listdatastore(7), lightning-deldatastore(7) | ||
lightning-listdatastore(7), lightning-deldatastore(7), lightning-datastoreusage(7) | ||
|
||
RESOURCES | ||
--------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
lightning-datastoreusage -- Command for listing datastore usage info | ||
============================================================ | ||
|
||
SYNOPSIS | ||
-------- | ||
|
||
**datastoreusage** | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
The **datastoreusage** RPC command allows the caller to fetch the | ||
total bytes that are stored under a certain *key* (or from the root), | ||
including the size of the *key*. | ||
|
||
All descendants of the *key* (or root) are taken into account. | ||
RETURN VALUE | ||
------------ | ||
|
||
[comment]: # (GENERATE-FROM-SCHEMA-START) | ||
On success, an object containing **datastoreusage** is returned. It is an object containing: | ||
|
||
- **key** (string): The key from which the database was traversed. | ||
- **total\_bytes** (u64): The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves. | ||
|
||
[comment]: # (GENERATE-FROM-SCHEMA-END) | ||
|
||
AUTHOR | ||
------ | ||
|
||
Peter Neuroth <<[email protected]>> is mainly responsible. | ||
|
||
SEE ALSO | ||
-------- | ||
|
||
lightning-datastore(7), lightning-deldatastore(7), lightning-listdatastore(7) | ||
|
||
RESOURCES | ||
--------- | ||
|
||
Main web site: <https://github.com/ElementsProject/lightning> | ||
|
||
[comment]: # ( SHA256STAMP:743b3308974872f191362fcd0b1af647ea1efd28ae30ea04f6deb22418871a17) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ Rusty Russell <<[email protected]>> is mainly responsible. | |
SEE ALSO | ||
-------- | ||
|
||
lightning-listdatastore(7), lightning-datastore(7) | ||
lightning-listdatastore(7), lightning-datastore(7), lightning-datastoreusage(7) | ||
|
||
RESOURCES | ||
--------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ Rusty Russell <<[email protected]>> is mainly responsible. | |
SEE ALSO | ||
-------- | ||
|
||
lightning-datastore(7), lightning-deldatastore(7) | ||
lightning-datastore(7), lightning-deldatastore(7), lightning-datastoreusage(7) | ||
|
||
RESOURCES | ||
--------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [], | ||
"added": "v23.11", | ||
"properties": { | ||
"key": { | ||
"oneOf": [ | ||
{ | ||
"type": "array", | ||
"description": "key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore.", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"datastoreusage" | ||
], | ||
"properties": { | ||
"datastoreusage": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"key", | ||
"total_bytes" | ||
], | ||
"properties": { | ||
"key": { | ||
"type": "string", | ||
"description": "The key from which the database was traversed." | ||
}, | ||
"total_bytes": { | ||
"type": "u64", | ||
"description": "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters