Sorry about that.
I parsed JSON data, which results in a vec of structs, for which each struct has a vec for metrics. The metric vec inside the struct contains two struct types, a name-value pair and a struct with name, total_count and total_sum (number of occurrences and the the total time of these occurrences, along with some extra statistical data, for now I am interested in total_count and total_sum). The name-value and name-total_count,total_sum statistics represent that statistic at a certain point in time.
At a later point in time, I request the same JSON structure, and get a JSON response, is likely to have an identical structure, but some altered values, based on server usage for value, total_count and total_sum. I say likely to have an identical structure, the JSON structure represents objects in a database, and objects can have be removed or added.
Based on JSON structure, I have a struct with the metric_type server, which represents a server, about which I want to display data, and a metric_type table, which represents a table, for which there can be several, and a metric_type tablet, which contains one or more shards which are connected to a table.
What I want to achieve, is collect the JSON data in two different periods of time, and then present the metrics as new minus old for: value, total_count and total_sum per metric_type, so:
Metric_type: server, id: yb.tabletserver
name: value
mem_tracker_Compressed_Read_Buffer_Receive 5555
name: count sum
handler_latency_outbound_call_time_to_response 5000 666666
Metric_type: table, table_name: benchmark_table
name: value
log_gc_running 5555
name: count sum
rocksdb_write_raw_block_micros 5000 666666
Metric_type:tablet, table_name: benchmark_table, id: 53c653c79e664b11a61aef1950132c7e
name: value
rocksdb_l0_hit 5555
rocksdb_l0_hit 5555
Metric_type:tablet, table_name: benchmark_table, id: 327da7d8f53445d5a09f962dec529de5
name: value
rocksdb_l0_hit 5555
rocksdb_l0_hit 5555
I put a minimal amount of metrics in the example, in reality there are a lot more per struct, and there are many more tables and tablets. I only want to see the metrics that have been changed and/or are non-zero.