Class: HKeyPerfDataReader::ConvertedType::PerfCounterDef
- Inherits:
-
Object
- Object
- HKeyPerfDataReader::ConvertedType::PerfCounterDef
- Defined in:
- lib/fluent/plugin/hkey_perf_data_converted_type.rb
Constant Summary collapse
- PERF_COUNTER_BASE =
0x30000- PERF_TIMER_100NS =
0x100000
Instance Attribute Summary collapse
-
#counter_offset ⇒ Object
readonly
Returns the value of attribute counter_offset.
-
#counter_size ⇒ Object
readonly
Returns the value of attribute counter_size.
-
#counter_type ⇒ Object
readonly
Returns the value of attribute counter_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, raw_counter_def) ⇒ PerfCounterDef
constructor
A new instance of PerfCounterDef.
- #is_base ⇒ Object
- #is_base_counter ⇒ Object
- #is_nano_second_counter ⇒ Object
Constructor Details
#initialize(name, raw_counter_def) ⇒ PerfCounterDef
Returns a new instance of PerfCounterDef.
73 74 75 76 77 78 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 73 def initialize(name, raw_counter_def) @name = name @counter_offset = raw_counter_def.counterOffset @counter_size = raw_counter_def.counterSize @counter_type = raw_counter_def.counterType end |
Instance Attribute Details
#counter_offset ⇒ Object (readonly)
Returns the value of attribute counter_offset.
65 66 67 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 65 def counter_offset @counter_offset end |
#counter_size ⇒ Object (readonly)
Returns the value of attribute counter_size.
66 67 68 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 66 def counter_size @counter_size end |
#counter_type ⇒ Object (readonly)
Returns the value of attribute counter_type.
67 68 69 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 67 def counter_type @counter_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
64 65 66 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 64 def name @name end |
Instance Method Details
#is_base ⇒ Object
80 81 82 83 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 80 def is_base # https://github.com/leoluk/perflib_exporter/blob/master/perflib/perflib.go is_base_counter && !is_nano_second_counter end |
#is_base_counter ⇒ Object
85 86 87 88 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 85 def is_base_counter # https://github.com/leoluk/perflib_exporter/blob/master/perflib/perflib.go (@counter_type & PERF_COUNTER_BASE) == PERF_COUNTER_BASE end |
#is_nano_second_counter ⇒ Object
90 91 92 93 |
# File 'lib/fluent/plugin/hkey_perf_data_converted_type.rb', line 90 def is_nano_second_counter # https://github.com/leoluk/perflib_exporter/blob/master/perflib/perflib.go (@counter_type & PERF_TIMER_100NS) == PERF_TIMER_100NS end |