使用pandas 把json 轉為csv
{
"responseHeader": {
"status": 0,
"QTime": 16
},
"metrics": {
"solr.core.BizXTest.shard1.replica_n1": {
"CACHE.searcher.filterCache": {
"lookups": 0,
"idleEvictions": 0,
"evictions": 0,
"cumulative_inserts": 0,
"ramBytesUsed": 1328,
"cumulative_hits": 0,
"cumulative_idleEvictions": 0,
"hits": 0,
"cumulative_evictions": 0,
"cleanupThread": false,
"size": 0,
"hitratio": 0.0,
"cumulative_lookups": 0,
"cumulative_hitratio": 0.0,
"warmupTime": 0,
"maxRamMB": -1,
"inserts": 0
}
},
"solr.core.sitescope.shard1.replica_n1": {
"CACHE.searcher.filterCache": {
"lookups": 1,
"idleEvictions": 1,
"evictions": 1,
"cumulative_inserts": 1,
"ramBytesUsed": 1329,
"cumulative_hits": 1,
"cumulative_idleEvictions": 1,
"hits": 1,
"cumulative_evictions": 1,
"cleanupThread": true,
"size": 1,
"hitratio": 1.0,
"cumulative_lookups": 1,
"cumulative_hitratio": 1.0,
"warmupTime": 1,
"maxRamMB": 1,
"inserts": 1
}
}
}
}
csv 列名為粗體字段,metrics 的值為solr.core.BizXTest.shard1.replica_n1, solr.core.sitescope.shard1.replica_n1,其他字段的值為json裡所對應的value