happybeing / vdash

A Dashboard for Autonomi Nodes that runs in the terminal
GNU Affero General Public License v3.0
19 stars 9 forks source link

Feature: display chunk storage for Adult nodes #6

Closed happybeing closed 2 years ago

happybeing commented 2 years ago

vdash used to show storage used for the local disk, and for each data type as a horizontal bar. This no longer works because the datavdash used to obtain this is no longer saved on disk by the node.

Ideally we'd like to show disk space used/available in first bar, and a bar under that for each data type (i.e. mutable and register).

This issue is for:

Note:

We have options for obtaining metrics for the storage device. vdash currently calls the system function statvfs() with the path for the storage location so that could continue to be used. Alternatively issue #5 is planned to gather disk related stats which could be used instead.

happybeing commented 2 years ago

Note:

checking if/how storage information is saved to disk (refer to safe_network node source)

A node is told how much space is allocated for its use, and tracks how much it has used in a struct UsedSpace which is accessed by the individual stores (i.e. ChunkDiskStore, RegisterStorage). Before each write this is checked to ensure sufficient space remains, and is increased if data is written. The space used is output after each write as three values: 'Used space', 'Max capacity' and 'Used space ratio'. Separately a 'storage level' is maintained with each level representing ~10% of total storage capacity, and a message ('Next level for storage has been reached') is output each time this value increases. These metrics are held in the struct DataStore.

check with MaidSafe if the current solution is temporary, and so whether we should defer this until more stable

There doesn't seem to be an easy way to output the storage used for individual data types (immutable and register) so this will no longer be shown.

happybeing commented 2 years ago

For now we are limited to showing total 'Used space' against total 'Max capacity'.

I think it would be better if this was contained in a single info message rather than the current three, one each for Used space, Max capacity and Used space ratio (here.) @joshuef - could you slip that change into an existing PR if you agree? For now I'll have vdash pick it out as is until you make the change. For ex:

info!("Used space: {:?}, Max capacity: {:?}, Used space ratio: {:?}", used, max_capacity, sed_space_ratio);
happybeing commented 2 years ago

Closed by https://github.com/happybeing/vdash/commit/e22b94ba1555999c7cbda6679b593361e17457cc