metrics: scaling: add datestamps to stats samples

Add invididual date entries to each statistics sample, to
suppliment the top level date entry. This helps order the
samples if we are flattening the data into say Elasticsearch.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
This commit is contained in:
Graham Whaley
2019-08-13 17:08:03 +01:00
committed by David Lyle
parent e4ef431b0f
commit 7b98d82e11
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -102,6 +102,10 @@ save_stats() {
local json="$(cat << EOF
{
"date": {
"ns": $(date +%s%N),
"Date": "$(date -u +"%Y-%m-%dT%T.%3N")"
},
"n_pods": {
"Result": ${n_pods},
"Units" : "int"
+9
View File
@@ -46,6 +46,15 @@ grab_stats() {
local mem_free=()
info "And grab some stats"
local date_json="$(cat << EOF
"date": {
"ns": $(date +%s%N),
"Date": "$(date -u +"%Y-%m-%dT%T.%3N")"
}
EOF
)"
metrics_json_add_array_fragment "$date_json"
local pods_json="$(cat << EOF
"n_pods": {
"Result": ${n_pods},