Skip to content

Commit

Permalink
Status Docs and Update (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Smart authored and Eric Schrock committed Oct 16, 2019
1 parent 9382e3e commit e7c3f9e
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 12 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.3.3
0.3.4
18 changes: 18 additions & 0 deletions config/reflect-config.json
Expand Up @@ -163,6 +163,24 @@
"allDeclaredClasses":true,
"allPublicClasses":true
},
{
"name":"io.titandata.models.RepositoryStatus",
"allDeclaredFields":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true,
"allDeclaredClasses":true,
"allPublicClasses":true
},
{
"name":"io.titandata.models.RepositoryVolumeStatus",
"allDeclaredFields":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true,
"allDeclaredClasses":true,
"allPublicClasses":true
},
{
"name":"io.titandata.models.Repository[]",
"allDeclaredFields":true,
Expand Down
44 changes: 41 additions & 3 deletions docs/src/cli/cmd/status.rst
Expand Up @@ -3,7 +3,45 @@
titan status
============

.. note::
Display the current status for a repository.

The status command is currently a stub and does not report real information.
This will be addressed in an upcoming release.
* Status - The current status of a repository (detached, running, stopped, etc...).
* Uncompressed Size - The Uncompressed Size of the repository on disk.
* Compressed Size - The Compressed Size of the repository on disk.
* Last Commit - The GUID (globally unique identifier) for the last commit.

For each volume, the following information is displayed:

* Volume - The path of the volume on the disk
* Uncompressed Size - The Uncompressed Size of the volume on disk.
* Compressed Size - The Compressed Size of the volume on disk.

All sizes reflect the size of the currently active volume state. As data is added, or if a different commit is checked out, these values will change.

Syntax
------

::

titan status <repository>

Arguments
---------

repository
*Required*. The name of the target repository.


Example
-------

::

$ titan status hello-world
Status: running
Uncompressed Size: 526.5 KiB
Compressed Size: 254 KiB
Last Commit: 12c6da4d57004d3497afca4fb914ed58

Volume Uncompressed Compressed
/var/lib/postgresql/data 31.7 MiB 6.9 MiB
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -7,7 +7,7 @@
<artifactId>titan</artifactId>
<name>Titan CLI</name>
<description></description>
<version>0.3.3</version>
<version>0.3.4</version>

<properties>
<java.version>1.8</java.version>
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/io/titandata/titan/providers/local/Status.kt
Expand Up @@ -29,16 +29,16 @@ class Status (
val status = repositoriesApi.getRepositoryStatus(container)
for(cont in getContainersStatus()) {
if(container == cont.name) {
System.out.printf("%15s %s${n}", "Status: ", cont.status)
System.out.printf("%20s %s${n}", "Status: ", cont.status)
}
}
System.out.printf("%15s %s${n}", "Logical Size: ", readableFileSize(status.logicalSize))
System.out.printf("%15s %s${n}", "Actual Size: ", readableFileSize(status.actualSize))
System.out.printf("%15s %s${n}", "Last Commit: ", status.lastCommit)
System.out.printf("%20s %s${n}", "Uncompressed Size: ", readableFileSize(status.logicalSize))
System.out.printf("%20s %s${n}", "Compressed Size: ", readableFileSize(status.actualSize))
System.out.printf("%20s %s${n}", "Last Commit: ", status.lastCommit)
println()
System.out.printf("%-30s %-10s %s${n}", "Volume", "Logical", "Actual")
System.out.printf("%-30s %-12s %s${n}", "Volume", "Uncompressed", "Compressed")
for (volume in status.volumeStatus) {
System.out.printf("%-30s %-10s %s${n}", volume.properties["path"], readableFileSize(volume.logicalSize), readableFileSize(volume.actualSize))
System.out.printf("%-30s %-12s %s${n}", volume.properties["path"], readableFileSize(volume.logicalSize), readableFileSize(volume.actualSize))
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/VERSION
@@ -1 +1 @@
0.3.3
0.3.4

0 comments on commit e7c3f9e

Please sign in to comment.