mirror of
https://github.com/clearlinux/cloud-native-setup.git
synced 2026-08-19 05:27:26 +00:00
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:
committed by
David Lyle
parent
e4ef431b0f
commit
7b98d82e11
@@ -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"
|
||||
|
||||
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user