Lines Matching refs:pool
146 for pool in d:
147 for objset in d[pool]:
148 print_values(d[pool][objset])
242 if parsed_args.pool:
243 pool_name = parsed_args.pool
283 def kstat_update(pool = None, objid = None):
286 if not pool:
292 file = "kstat.zfs." + pool + ".dataset.objset-" + objid
297 file = "kstat.zfs." + pool + ".dataset"
299 obj_start = len("kstat.zfs." + pool + ".")
332 def kstat_update(pool = None, objid = None):
335 if not pool:
340 file = "/proc/spl/kstat/zfs/" + pool + "/objset-" + objid
345 print("Pool \"" + pool + "\" does not exist, Exitting")
351 file = "/proc/spl/kstat/zfs/" + pool + "/" + objid
402 for pool, objids in ds_pairs.items():
404 kstat_update(pool, objid)
405 zil_build_dict(pool)
414 for pool in pools:
415 kstat_update(pool)
416 zil_build_dict(pool)
423 for pool in curr:
424 for objset in curr[pool]:
425 for key in curr[pool][objset]:
426 if not isinstance(diff[pool][objset][key], int):
431 diff[pool][objset][key] = 0
433 diff[pool][objset][key] \
434 = curr[pool][objset][key] \
435 - prev[pool][objset][key]
437 def zil_build_dict(pool = "GLOBAL"):
442 if pool not in curr:
443 curr[pool] = dict()
444 if objset not in curr[pool]:
445 curr[pool][objset] = dict()
446 curr[pool][objset][key] = val
450 for pool in diff:
451 for objset in diff[pool]:
452 diff[pool][objset]["pool"] = pool
453 diff[pool][objset]["objset"] = objset
454 diff[pool][objset]["time"] = time.strftime("%H:%M:%S", \
456 diff[pool][objset]["icc+inc"] = \
457 diff[pool][objset]["zil_itx_copied_count"] + \
458 diff[pool][objset]["zil_itx_needcopy_count"]
459 diff[pool][objset]["icb+inb"] = \
460 diff[pool][objset]["zil_itx_copied_bytes"] + \
461 diff[pool][objset]["zil_itx_needcopy_bytes"]
462 diff[pool][objset]["iic+idc"] = \
463 diff[pool][objset]["zil_itx_indirect_count"] + \
464 diff[pool][objset]["zil_itx_copied_count"] + \
465 diff[pool][objset]["zil_itx_needcopy_count"]
466 diff[pool][objset]["iib+idb"] = \
467 diff[pool][objset]["zil_itx_indirect_bytes"] + \
468 diff[pool][objset]["zil_itx_copied_bytes"] + \
469 diff[pool][objset]["zil_itx_needcopy_bytes"]
470 diff[pool][objset]["imnc+imsc"] = \
471 diff[pool][objset]["zil_itx_metaslab_normal_count"] + \
472 diff[pool][objset]["zil_itx_metaslab_slog_count"]
473 diff[pool][objset]["imnb+imsb"] = \
474 diff[pool][objset]["zil_itx_metaslab_normal_bytes"] + \
475 diff[pool][objset]["zil_itx_metaslab_slog_bytes"]
476 diff[pool][objset]["imnw+imsw"] = \
477 diff[pool][objset]["zil_itx_metaslab_normal_write"] + \
478 diff[pool][objset]["zil_itx_metaslab_slog_write"]
479 diff[pool][objset]["imna+imsa"] = \
480 diff[pool][objset]["zil_itx_metaslab_normal_alloc"] + \
481 diff[pool][objset]["zil_itx_metaslab_slog_alloc"]
482 if diff[pool][objset]["imna+imsa"] > 0:
483 diff[pool][objset]["imb/ima"] = 100 * \
484 diff[pool][objset]["imnb+imsb"] // \
485 diff[pool][objset]["imna+imsa"]
487 diff[pool][objset]["imb/ima"] = 100
488 if diff[pool][objset]["zil_itx_metaslab_normal_alloc"] > 0:
489 diff[pool][objset]["imnb/imna"] = 100 * \
490 diff[pool][objset]["zil_itx_metaslab_normal_bytes"] // \
491 diff[pool][objset]["zil_itx_metaslab_normal_alloc"]
493 diff[pool][objset]["imnb/imna"] = 100
494 if diff[pool][objset]["zil_itx_metaslab_slog_alloc"] > 0:
495 diff[pool][objset]["imsb/imsa"] = 100 * \
496 diff[pool][objset]["zil_itx_metaslab_slog_bytes"] // \
497 diff[pool][objset]["zil_itx_metaslab_slog_alloc"]
499 diff[pool][objset]["imsb/imsa"] = 100
500 if diff[pool][objset]["imnw+imsw"] > 0:
501 diff[pool][objset]["imb/imw"] = 100 * \
502 diff[pool][objset]["imnb+imsb"] // \
503 diff[pool][objset]["imnw+imsw"]
505 diff[pool][objset]["imb/imw"] = 100
506 if diff[pool][objset]["zil_itx_metaslab_normal_alloc"] > 0:
507 diff[pool][objset]["imnb/imnw"] = 100 * \
508 diff[pool][objset]["zil_itx_metaslab_normal_bytes"] // \
509 diff[pool][objset]["zil_itx_metaslab_normal_write"]
511 diff[pool][objset]["imnb/imnw"] = 100
512 if diff[pool][objset]["zil_itx_metaslab_slog_alloc"] > 0:
513 diff[pool][objset]["imsb/imsw"] = 100 * \
514 diff[pool][objset]["zil_itx_metaslab_slog_bytes"] // \
515 diff[pool][objset]["zil_itx_metaslab_slog_write"]
517 diff[pool][objset]["imsb/imsw"] = 100