Skip to content

Commit

Permalink
Fixed missing HDF5 metrics declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
bzizou committed Sep 3, 2020
1 parent 31a5986 commit 94d498f
Showing 1 changed file with 105 additions and 1 deletion.
106 changes: 105 additions & 1 deletion colmet/collector/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ class HDF5TableDescription(tables.IsDescription):
hostname = tables.StringCol(255)
job_id = tables.Int64Col(dflt=-1)
metric_backend = tables.StringCol(255)
involved_jobs = tables.StringCol(8192)

counter_1 = tables.Int64Col(dflt=-1)
counter_2 = tables.Int64Col(dflt=-1)
Expand Down Expand Up @@ -335,6 +336,7 @@ class HDF5TableDescription(tables.IsDescription):
hostname = tables.StringCol(255)
job_id = tables.Int64Col(dflt=-1)
metric_backend = tables.StringCol(255)
involved_jobs = tables.StringCol(8192)

portXmitData = tables.Int64Col(dflt=-1)
portRcvData = tables.Int64Col(dflt=-1)
Expand Down Expand Up @@ -467,6 +469,106 @@ def to_row(cls, row, counters):
if key not in cls.missing_keys:
cls.missing_keys.append(key)
LOG.warning(e)


class JobprocstatsCounters(object):
Counters = get_counters_class("jobprocstats_default")

class HDF5TableDescription(tables.IsDescription):
timestamp = tables.Int64Col(dflt=-1)
hostname = tables.StringCol(255)
job_id = tables.Int64Col(dflt=-1)
metric_backend = tables.StringCol(255)

rchar = tables.Int64Col(dflt=-1)
wchar = tables.Int64Col(dflt=-1)
syscr = tables.Int64Col(dflt=-1)
syscw = tables.Int64Col(dflt=-1)
read_bytes = tables.Int64Col(dflt=-1)
write_bytes = tables.Int64Col(dflt=-1)
cancelled_write_bytes = tables.Int64Col(dflt=-1)

missing_keys = []

@classmethod
def get_table_description(cls):
return cls.HDF5TableDescription

@classmethod
def to_counters(cls, row):
counters = cls.Counters()
for key in list(cls.Counters._header_definitions):
counters._set_header(key, row[key])

for key in list(cls.Counters._counter_definitions):
counters._set_counter(key, row[key])
return counters

@classmethod
def to_row(cls, row, counters):
for key in list(cls.Counters._header_definitions):
try:
row[key] = counters._get_header(key)
except Exception as e:
if key not in cls.missing_keys:
cls.missing_keys.append(key)
LOG.warning(e)
for key in list(cls.Counters._counter_definitions):
try:
row[key] = counters._get_counter(key)
except Exception as e:
if key not in cls.missing_keys:
cls.missing_keys.append(key)
LOG.warning(e)


class IpmipowerstatsCounters(object):
Counters = get_counters_class("ipmipowerstats_default")

class HDF5TableDescription(tables.IsDescription):

timestamp = tables.Int64Col(dflt=-1)
hostname = tables.StringCol(255)
job_id = tables.Int64Col(dflt=-1)
metric_backend = tables.StringCol(255)
involved_jobs = tables.StringCol(8192)

average_power_consumption = tables.Int64Col(dflt=-1)

missing_keys = []

@classmethod
def get_table_description(cls):
return cls.HDF5TableDescription

@classmethod
def to_counters(cls, row):
counters = cls.Counters()
for key in list(cls.Counters._header_definitions):
counters._set_header(key, row[key])

for key in list(cls.Counters._counter_definitions):
counters._set_counter(key, row[key])
return counters

@classmethod
def to_row(cls, row, counters):
for key in list(cls.Counters._header_definitions):
try:
row[key] = counters._get_header(key)
except Exception as e:
if key not in cls.missing_keys:
cls.missing_keys.append(key)
LOG.warning(e)
for key in list(cls.Counters._counter_definitions):
try:
row[key] = counters._get_counter(key)
except Exception as e:
if key not in cls.missing_keys:
cls.missing_keys.append(key)
LOG.warning(e)



class HDF5OutputBackend(OutputBaseBackend):
'''
Expand Down Expand Up @@ -547,7 +649,9 @@ class JobFile(object):
'temperaturestats_default': HDF5TemperatureStatsCounters,
'lustrestats_default': HDF5LustreStatsCounters,
'RAPLstats_default': HDF5RAPLStatsCounters,
'perfhwstats_default': HDF5PerfhwCounters
'perfhwstats_default': HDF5PerfhwCounters,
'jobprocstats_default': JobprocstatsCounters,
'ipmipowerstats_default': IpmipowerstatsCounters
}
path_level = 4

Expand Down

0 comments on commit 94d498f

Please sign in to comment.