-
Notifications
You must be signed in to change notification settings - Fork 0
/
bom-query.json
1 lines (1 loc) · 1.08 KB
/
bom-query.json
1
{"aggs":{"stats":{"multi_terms":{"terms":[{"field":"ACCOUNTING_NAME"},{"field":"NUM_EXEC_PROCS"},{"field":"Job"}],"size":1000},"aggs":{"cpu_avail_sec":{"sum":{"field":"AVAIL_CPU_TIME_SEC"}},"cpu_wasted_sec":{"sum":{"field":"WASTED_CPU_SECONDS"}},"mem_avail_mb_sec":{"sum":{"field":"MEM_REQUESTED_MB_SEC"}},"mem_wasted_mb_sec":{"sum":{"field":"WASTED_MB_SECONDS"}},"wasted_cost":{"scripted_metric":{"init_script":"state.costs = []","map_script":"double cpu_cost = doc.WASTED_CPU_SECONDS.value * params.cpu_second; double mem_cost = doc.WASTED_MB_SECONDS.value * params.mb_second; state.costs.add(Math.max(cpu_cost, mem_cost))","combine_script":"double total = 0; for (t in state.costs) { total += t } return total","reduce_script":"double total = 0; for (a in states) { total += a } return total","params":{"cpu_second":7.0556e-07,"mb_second":5.8865e-11}}}}}},"size":0,"query":{"bool":{"filter":[{"match_phrase":{"META_CLUSTER_NAME":"farm"}},{"range":{"timestamp":{"lte":"2024-06-04T00:00:00Z","gte":"2024-05-04T00:00:00Z","format":"strict_date_optional_time"}}},{"match_phrase":{"BOM":"Human Genetics"}}]}}}