aria.ops.definition.units

  1#  Copyright 2022 VMware, Inc.
  2#  SPDX-License-Identifier: Apache-2.0
  3from dataclasses import dataclass
  4
  5from aenum import Enum
  6from aenum import skip
  7
  8
  9# All units should be standardized to ISO 80000 (International System of Quantities) abbreviations.
 10# If a metric's unit is bits or bytes, but should use the base-2 paths, set the unit to bibit or bibyte, respectively
 11# "per X" should be spelled out, with 'per X' all lowercase and spelled out
 12# "Y per X" should be "y/x", with X and Y both abbreviated (if possible)
 13# non-ISO units should be abbreviated, if a common english abbreviation exists (e.g., week->wk)
 14# Units that are not common units (e.g., blocks) should be lower case and spelled out
 15
 16
 17@dataclass
 18class Unit:
 19    key: str
 20    label: str
 21    _order: int
 22    _conversion_factor: int
 23    _subtype: str = ""
 24    is_rate: bool = False
 25
 26
 27class UnitGroup(Enum):  # type: ignore
 28    pass
 29
 30
 31@skip
 32class Ratio(UnitGroup):
 33    PERCENT = Unit("percent", "%", 1, 1)
 34
 35
 36@skip
 37class Time(UnitGroup):
 38    PICOSECONDS = Unit("picoseconds", "ps", 1, 1)
 39    NANOSECONDS = Unit("nanoseconds", "ns", 2, 1000)
 40    MICROSECONDS = Unit("microseconds", "μs", 3, 1000)
 41    MILLISECONDS = Unit("milliseconds", "ms", 4, 1000)
 42    CENTISECONDS = Unit("centiseconds", "cs", 5, 10)
 43    SECONDS = Unit("seconds", "s", 6, 100)
 44    MINUTES = Unit("minutes", "min", 7, 60)
 45    HOURS = Unit("hours", "h", 8, 60)
 46    DAYS = Unit("days", "d", 9, 24)
 47    WEEKS = Unit("weeks", "wk", 10, 7)  # No ISO Standard for week
 48
 49
 50# Some databases use time rates to measure CPU usage, e.g., as CPU Time per Wall Clock Time
 51@skip
 52class TimeRate(UnitGroup):
 53    PICOSECONDS_PER_SEC = Unit("picoseconds_per_sec", "ps/s", 1, 1, is_rate=True)
 54    NANOSECONDS_PER_SEC = Unit("nanoseconds_per_sec", "ns/s", 2, 1000, is_rate=True)
 55    MICROSECONDS_PER_SEC = Unit("microseconds_per_sec", "μs/s", 3, 1000, is_rate=True)
 56    MILLISECONDS_PER_SEC = Unit("milliseconds_per_sec", "ms/s", 4, 1000, is_rate=True)
 57    CENTISECONDS_PER_SEC = Unit("centiseconds_per_sec", "cs/s", 5, 10, is_rate=True)
 58    SECONDS_PER_SEC = Unit("seconds_per_sec", "s/s", 6, 100, is_rate=True)
 59    MINUTES_PER_SEC = Unit("minutes_per_sec", "min/s", 7, 60, is_rate=True)
 60    HOURS_PER_SEC = Unit("hours_per_sec", "h/s", 8, 60, is_rate=True)
 61    DAYS_PER_SEC = Unit("days_per_sec", "d/s", 9, 24, is_rate=True)
 62    WEEKS_PER_SEC = Unit("weeks_per_sec", "wk/s", 10, 7, is_rate=True)
 63
 64
 65@skip
 66class Rate(UnitGroup):
 67    PER_PICOSECOND = Unit("per_picosecond", "per picosecond", 1, 1, is_rate=True)
 68    PER_NANOSECOND = Unit("per_nanosecond", "per nanosecond", 2, 1000, is_rate=True)
 69    PER_MICROSECOND = Unit("per_microsecond", "per microsecond", 3, 1000, is_rate=True)
 70    PER_MILLISECOND = Unit("per_millisecond", "per millisecond", 4, 1000, is_rate=True)
 71    PER_SECOND = Unit("per_second", "per second", 5, 1000, is_rate=True)
 72    PER_MINUTE = Unit("per_minute", "per minute", 6, 60, is_rate=True)
 73    PER_HOUR = Unit("per_hour", "per hour", 7, 60, is_rate=True)
 74    PER_DAY = Unit("per_day", "per day", 8, 24, is_rate=True)
 75    PER_WEEK = Unit("per_week", "per week", 9, 7, is_rate=True)
 76
 77
 78@skip
 79class DataSize(UnitGroup):
 80    BIT = Unit("bit", "b", 1, 1)
 81    KILOBIT = Unit("kilobit", "kbit", 2, 1000, "bits_base_10")
 82    MEGABIT = Unit("megabit", "Mbit", 3, 1000, "bits_base_10")
 83    GIGABIT = Unit("gigabit", "Gbit", 4, 1000, "bits_base_10")
 84    TERABIT = Unit("terabit", "Tbit", 5, 1000, "bits_base_10")
 85    PETABIT = Unit("petabit", "Pbit", 6, 1000, "bits_base_10")
 86    EXABIT = Unit("exabit", "Ebit", 7, 1000, "bits_base_10")
 87    ZETTABIT = Unit("zettabit", "Zbit", 8, 1000, "bits_base_10")
 88    YOTTABIT = Unit("yottabit", "Ybit", 9, 1000, "bits_base_10")
 89    BYTE = Unit("byte", "B", 1, 1, "bytes_base_10")
 90    KILOBYTE = Unit("kilobyte", "kB", 2, 1000, "bytes_base_10")
 91    MEGABYTE = Unit("megabyte", "MB", 3, 1000, "bytes_base_10")
 92    GIGABYTE = Unit("gigabyte", "GB", 4, 1000, "bytes_base_10")
 93    TERABYTE = Unit("terabyte", "TB", 5, 1000, "bytes_base_10")
 94    PETABYTE = Unit("petabyte", "PB", 6, 1000, "bytes_base_10")
 95    EXABYTE = Unit("exabyte", "EB", 7, 1000, "bytes_base_10")
 96    ZETTABYTE = Unit("zettabyte", "ZB", 8, 1000, "bytes_base_10")
 97    YOTTABYTE = Unit("yottabyte", "YB", 9, 1000, "bytes_base_10")
 98    BIBIT = Unit("bibit", "b", 1, 1, "bits_base_2")
 99    KIBIBIT = Unit("kibibit", "Kibit", 2, 1024, "bits_base_2")
100    MEBIBIT = Unit("mebibit", "Mibit", 3, 1024, "bits_base_2")
101    GIBIBIT = Unit("gibibit", "Gibit", 4, 1024, "bits_base_2")
102    TEBIBIT = Unit("tebibit", "Tibit", 5, 1024, "bits_base_2")
103    PEBIBIT = Unit("pebibit", "Pibit", 6, 1024, "bits_base_2")
104    EXBIBIT = Unit("exbibit", "Eibit", 7, 1024, "bits_base_2")
105    ZEBIBIT = Unit("zebibit", "Zibit", 8, 1024, "bits_base_2")
106    YOBIBIT = Unit("yobibit", "Yibit", 9, 1024, "bits_base_2")
107    BIBYTE = Unit("bibyte", "b", 1, 1, "bytes_base_2")
108    KIBIBYTE = Unit(
109        "kibibyte", "KiB", 2, 1024, "bytes_base_2"
110    )  # per ISO 80000, this does not follow the convention of lower-case k for kilo
111    MEBIBYTE = Unit("mebibyte", "MiB", 3, 1024, "bytes_base_2")
112    GIBIBYTE = Unit("gibibyte", "GiB", 4, 1024, "bytes_base_2")
113    TEBIBYTE = Unit("tebibyte", "TiB", 5, 1024, "bytes_base_2")
114    PEBIBYTE = Unit("pebibyte", "PiB", 6, 1024, "bytes_base_2")
115    EXBIBYTE = Unit("exbibyte", "EiB", 7, 1024, "bytes_base_2")
116    ZEBIBYTE = Unit("zebibyte", "ZiB", 8, 1024, "bytes_base_2")
117    YOBIBYTE = Unit("yobibyte", "YiB", 9, 1024, "bytes_base_2")
118
119
120@skip
121class DataRate(UnitGroup):
122    BIT_PER_SECOND = Unit("bitps", "bit/s", 1, 1, "bits_base_10", is_rate=True)
123    KILOBIT_PER_SECOND = Unit("kbitps", "kbit/s", 2, 1000, "bits_base_10", is_rate=True)
124    MEGABIT_PER_SECOND = Unit("mbitps", "Mbit/s", 3, 1000, "bits_base_10", is_rate=True)
125    GIGABIT_PER_SECOND = Unit("gbitps", "Gbit/s", 4, 1000, "bits_base_10", is_rate=True)
126    TERABIT_PER_SECOND = Unit("tbitps", "Tbit/s", 5, 1000, "bits_base_10", is_rate=True)
127    PETABIT_PER_SECOND = Unit("pbitps", "Pbit/s", 6, 1000, "bits_base_10", is_rate=True)
128    EXABIT_PER_SECOND = Unit("ebitps", "Ebit/s", 7, 1000, "bits_base_10", is_rate=True)
129    ZETTABIT_PER_SECOND = Unit(
130        "zbitps", "Zbit/s", 8, 1000, "bits_base_10", is_rate=True
131    )
132    YOTTABIT_PER_SECOND = Unit(
133        "ybitps", "Ybit/s", 9, 1000, "bits_base_10", is_rate=True
134    )
135    BYTE_PER_SECOND = Unit("byteps", "B/s", 1, 1, "bytes_base_10", is_rate=True)
136    KILOBYTE_PER_SECOND = Unit(
137        "kbyteps", "kB/s", 2, 1000, "bytes_base_10", is_rate=True
138    )
139    MEGABYTE_PER_SECOND = Unit(
140        "mbyteps", "MB/s", 3, 1000, "bytes_base_10", is_rate=True
141    )
142    GIGABYTE_PER_SECOND = Unit(
143        "gbyteps", "GB/s", 4, 1000, "bytes_base_10", is_rate=True
144    )
145    TERABYTE_PER_SECOND = Unit(
146        "tbyteps", "TB/s", 5, 1000, "bytes_base_10", is_rate=True
147    )
148    PETABYTE_PER_SECOND = Unit(
149        "pbyteps", "PB/s", 6, 1000, "bytes_base_10", is_rate=True
150    )
151    EXABYTE_PER_SECOND = Unit("ebyteps", "EB/s", 7, 1000, "bytes_base_10", is_rate=True)
152    ZETTABYTE_PER_SECOND = Unit(
153        "zbyteps", "ZB/s", 8, 1000, "bytes_base_10", is_rate=True
154    )
155    YOTTABYTE_PER_SECOND = Unit(
156        "ybyteps", "YB/s", 9, 1000, "bytes_base_10", is_rate=True
157    )
158    BIBIT_PER_SECOND = Unit("bibitps", "bit/s", 1, 1, "bits_base_2", is_rate=True)
159    KIBIBIT_PER_SECOND = Unit(
160        "kibibitps", "kibit/s", 2, 1024, "bits_base_2", is_rate=True
161    )
162    MEBIBIT_PER_SECOND = Unit(
163        "mebibitps", "Mibit/s", 3, 1024, "bits_base_2", is_rate=True
164    )
165    GIBIBIT_PER_SECOND = Unit(
166        "gibibitps", "Gibit/s", 4, 1024, "bits_base_2", is_rate=True
167    )
168    TEBIBIT_PER_SECOND = Unit(
169        "tebibitps", "Tibit/s", 5, 1024, "bits_base_2", is_rate=True
170    )
171    PEBIBIT_PER_SECOND = Unit(
172        "pebibitps", "Pibit/s", 6, 1024, "bits_base_2", is_rate=True
173    )
174    EXBIBIT_PER_SECOND = Unit(
175        "exbibitps", "Eibit/s", 7, 1024, "bits_base_2", is_rate=True
176    )
177    ZEBIBIT_PER_SECOND = Unit(
178        "zebibitps", "Zibit/s", 8, 1024, "bits_base_2", is_rate=True
179    )
180    YOBIBIT_PER_SECOND = Unit(
181        "yobibitps", "Yibit/s", 9, 1024, "bits_base_2", is_rate=True
182    )
183    BIBYTE_PER_SECOND = Unit("bibyteps", "B/s", 1, 1, "bytes_base_2", is_rate=True)
184    KIBIBYTE_PER_SECOND = Unit(
185        "kibibyteps", "KiB/s", 2, 1024, "bytes_base_2", is_rate=True
186    )  # per ISO 80000, this does not follow the convention of lower-case k for kilo
187    MEBIBYTE_PER_SECOND = Unit(
188        "mebibyteps", "MiB/s", 3, 1024, "bytes_base_2", is_rate=True
189    )
190    GIBIBYTE_PER_SECOND = Unit(
191        "gibibyteps", "GiB/s", 4, 1024, "bytes_base_2", is_rate=True
192    )
193    TEBIBYTE_PER_SECOND = Unit(
194        "tebibyteps", "TiB/s", 5, 1024, "bytes_base_2", is_rate=True
195    )
196    PEBIBYTE_PER_SECOND = Unit(
197        "pebibyteps", "PiB/s", 6, 1024, "bytes_base_2", is_rate=True
198    )
199    EXBIBYTE_PER_SECOND = Unit(
200        "exbibyteps", "EiB/s", 7, 1024, "bytes_base_2", is_rate=True
201    )
202    ZEBIBYTE_PER_SECOND = Unit(
203        "zebibyteps", "ZiB/s", 8, 1024, "bytes_base_2", is_rate=True
204    )
205    YOBIBYTE_PER_SECOND = Unit(
206        "yobibyteps", "YiB/s", 9, 1024, "bytes_base_2", is_rate=True
207    )
208
209
210@skip
211class Frequency(UnitGroup):
212    HERTZ = Unit("hertz", "Hz", 1, 1, is_rate=True)
213    KILOHERTZ = Unit("kilohertz", "kHz", 2, 1000, is_rate=True)
214    MEGAHERTZ = Unit("megahertz", "MHz", 3, 1000, is_rate=True)
215    GIGAHERTZ = Unit("gigahertz", "GHz", 4, 1000, is_rate=True)
216    TERAHERTZ = Unit("terahertz", "THz", 5, 1000, is_rate=True)
217    PETAHERTZ = Unit("petahertz", "PHz", 6, 1000, is_rate=True)
218    EXAHERTZ = Unit("exahertz", "EHz", 7, 1000, is_rate=True)
219
220
221@skip
222class Power(UnitGroup):
223    NANOWATT = Unit("nanowatt", "nW", 1, 1, is_rate=True)
224    MICROWATT = Unit("microwatt", "μW", 2, 1000, is_rate=True)
225    MILLIWATT = Unit("milliwatt", "mW", 3, 1000, is_rate=True)
226    WATT = Unit("watt", "W", 4, 1000, is_rate=True)
227    KILOWATT = Unit("kilowatt", "kW", 5, 1000, is_rate=True)
228    MEGAWATT = Unit("megawatt", "MW", 6, 1000, is_rate=True)
229    GIGAWATT = Unit("gigawatt", "GW", 7, 1000, is_rate=True)
230    TERAWATT = Unit("terawatt", "TW", 8, 1000, is_rate=True)
231
232
233@skip
234class Energy(UnitGroup):
235    NANOWATT_HOURS = Unit("nanowatthours", "nW·h", 1, 1)
236    MICROWATT_HOURS = Unit("microwatthours", "μW·h", 2, 1000)
237    MILLIWATT_HOURS = Unit("milliwatthours", "mW·h", 3, 1000)
238    WATT_HOURS = Unit("watthours", "W·h", 4, 1000)
239    KILOWATT_HOURS = Unit("kilowatthours", "kW·h", 5, 1000)
240    MEGAWATT_HOURS = Unit("megawatthours", "MW·h", 6, 1000)
241    GIGAWATT_HOURS = Unit("gigawatthours", "GW·h", 7, 1000)
242    TERAWATT_HOURS = Unit("terawatthours", "TW·h", 8, 1000)
243
244
245@skip
246class Resistance(UnitGroup):
247    NANOOHM = Unit("nanoohm", "nΩ", 1, 1)
248    MICROOHM = Unit("microohm", "μΩ", 2, 1000)
249    MILLIOHM = Unit("milliohm", "mΩ", 3, 1000)
250    OHM = Unit("ohm", "Ω", 4, 1000)
251    KILOOHM = Unit("kiloohm", "kΩ", 5, 1000)
252    MEGAOHM = Unit("megaohm", "MΩ", 6, 1000)
253    GIGAOHM = Unit("gigaohm", "GΩ", 7, 1000)
254    TERAOHM = Unit("teraohm", "TΩ", 8, 1000)
255
256
257@skip
258class Voltage(UnitGroup):
259    NANOVOLTS = Unit("nanovolts", "nV", 1, 1)
260    MICROVOLTS = Unit("microvolts", "μV", 2, 1000)
261    MILLIVOLTS = Unit("millivolts", "mV", 3, 1000)
262    VOLTS = Unit("volts", "V", 4, 1000)
263    KILOVOLTS = Unit("kilovolts", "kV", 5, 1000)
264    MEGAVOLTS = Unit("megavolts", "MV", 6, 1000)
265    GIGAVOLTS = Unit("gigavolts", "GV", 7, 1000)
266    TERAVOLTS = Unit("teravolts", "TV", 8, 1000)
267
268
269@skip
270class Current(UnitGroup):
271    NANOAMPS = Unit("nanoamps", "nA", 1, 1)
272    MICROAMPS = Unit("microamps", "μA", 2, 1000)
273    MILLIAMPS = Unit("milliamps", "mA", 3, 1000)
274    AMPS = Unit("amps", "A", 4, 1000)
275    KILOAMPS = Unit("kiloamps", "kA", 5, 1000)
276    MEGAAMPS = Unit("megaamps", "MA", 6, 1000)
277    GIGAAMPS = Unit("gigaamps", "GA", 7, 1000)
278    TERAAMPS = Unit("teraamps", "TA", 8, 1000)
279
280
281@skip
282class Charge(UnitGroup):
283    NANOAMP_HOURS = Unit("nanoamphours", "nA·h", 1, 1)
284    MICROAMP_HOURS = Unit("microamphours", "μA·h", 2, 1000)
285    MILLIAMP_HOURS = Unit("milliamphours", "mA·h", 3, 1000)
286    AMP_HOURS = Unit("amphours", "A·h", 4, 1000)
287    KILOAMP_HOURS = Unit("kiloamphours", "kA·h", 5, 1000)
288    MEGAAMP_HOURS = Unit("megaamphours", "MA·h", 6, 1000)
289    GIGAAMP_HOURS = Unit("gigaamphours", "GA·h", 7, 1000)
290    TERAAMP_HOURS = Unit("teraamphours", "TA·h", 8, 1000)
291
292
293@skip
294class Temperature(UnitGroup):
295    C = Unit("celcius", "°C", 1, 1, "celcius")
296    K = Unit("kelvin", "K", 1, 1, "kelvin")
297    F = Unit("fahrenheit", "°F", 1, 1, "fahrenheit")
298
299
300# Note: According to SI, 'rpm' is not a unit
301@skip
302class RotationRate(UnitGroup):
303    RPM = Unit("rpm", "rpm", 1, 1, is_rate=True)
304
305
306@skip
307class Misc(UnitGroup):
308    CORES = Unit("cores", "cores", 1, 1, "Cores")
309    MILLICORES = Unit("millicores", "millicores", 1, 1, "Millicores")
310    BLOCKS = Unit("blocks", "blocks", 1, 1, "Blocks")
311    BLOCKS_PER_SECOND = Unit(
312        "blocksps", "blocks/s", 1, 1, "BlocksPerSecond", is_rate=True
313    )
314    PAGES = Unit("pages", "pages", 1, 1, "Pages")
315    PAGES_PER_SECOND = Unit("pagesps", "pages/s", 1, 1, "PagesPerSecond", is_rate=True)
316    PACKETS = Unit("packets", "packets", 1, 1, "Packets")
317    PACKETS_PER_SECOND = Unit(
318        "packetsps", "packets/s", 1, 1, "PacketsPerSecond", is_rate=True
319    )
320    FRAMES = Unit("frames", "frames", 1, 1, "Frames")
321    FRAMES_PER_SECOND = Unit(
322        "framesps", "frames/s", 1, 1, "FramesPerSecond", is_rate=True
323    )
324    OPERATIONS = Unit("operations", "operations", 1, 1, "Operations")
325    OPERATIONS_PER_SECOND = Unit(
326        "operationsps", "operations/s", 1, 1, "OperationsPerSecond", is_rate=True
327    )
328    IO_OPERATIONS_PER_SECOND = Unit("iops", "IOPS", 1, 1, "IOPS")
329    REQUESTS = Unit("requests", "requests", 1, 1, "Requests")
330    REQUESTS_PER_SECOND = Unit(
331        "requestsps", "requests/s", 1, 1, "RequestsPerSecond", is_rate=True
332    )
333    CALLS = Unit("calls", "calls", 1, 1, "Calls")
334    CALLS_PER_SECOND = Unit("callsps", "calls/s", 1, 1, "CallsPerSecond", is_rate=True)
335    ERRORS = Unit("errors", "errors", 1, 1, "Errors")
336    ERRORS_PER_SECOND = Unit(
337        "errorsps", "errors/s", 1, 1, "ErrorsPerSecond", is_rate=True
338    )
339    FLOPS = Unit("flops", "flops", 1, 1, "FLOPS", is_rate=True)
340    KILOFLOPS = Unit("kiloflops", "kiloflops", 2, 1000, "FLOPS", is_rate=True)
341    MEGAFLOPS = Unit("megaflops", "megaflops", 3, 1000, "FLOPS", is_rate=True)
342    GIGAFLOPS = Unit("gigaflops", "gigaflops", 4, 1000, "FLOPS", is_rate=True)
343    TERAFLOPS = Unit("teraflops", "teraflops", 5, 1000, "FLOPS", is_rate=True)
344    PETAFLOPS = Unit("petaflops", "petaflops", 6, 1000, "FLOPS", is_rate=True)
345    EXAFLOPS = Unit("exaflops", "exaflops", 7, 1000, "FLOPS", is_rate=True)
346    RACK_UNIT = Unit("rackunit", "rack unit", 1, 1, "RackUnits")
347    SESSIONS = Unit("sessions", "sessions", 1, 1, "Sessions")
348    CONNECTIONS = Unit("connections", "connections", 1, 1, "Connections")
349    CONNECTIONS_PER_SECOND = Unit(
350        "connectionsps", "connections/s", 1, 1, "ConnectionsPerSecond", is_rate=True
351    )
352    DISKS = Unit("disks", "disks", 1, 1, "Disks")
353    PURGES = Unit("purges", "purges", 1, 1, "Purges")
354    PURGES_PER_SECOND = Unit(
355        "purgesps", "purges/s", 1, 1, "PurgesPerSecond", is_rate=True
356    )
357    READS = Unit("reads", "reads", 1, 1, "Reads")
358    READS_PER_SECOND = Unit("readsps", "reads/s", 1, 1, "ReadsPerSecond", is_rate=True)
359    SEARCHES = Unit("searches", "searches", 1, 1, "Searches")
360    SEARCHES_PER_SECOND = Unit(
361        "searchesps", "searches/s", 1, 1, "SearchesPerSecond", is_rate=True
362    )
363    SLOTS = Unit("slots", "slots", 1, 1, "Slots")
364    SLOTS_PER_SECOND = Unit("slotsps", "slots/s", 1, 1, "SlotsPerSecond", is_rate=True)
365    THREADS = Unit("threads", "threads", 1, 1, "Threads")
366    WAITS = Unit("waits", "waits", 1, 1, "Waits")
367    WAITS_PER_SECOND = Unit("waitsps", "waits/s", 1, 1, "WaitsPerSecond", is_rate=True)
368    WRITES = Unit("writes", "writes", 1, 1, "Writes")
369    WRITES_PER_SECOND = Unit(
370        "writesps", "writes/s", 1, 1, "WritesPerSecond", is_rate=True
371    )
372    ATTEMPTS = Unit("attempts", "attempts", 1, 1, "Attempts")
373    ATTEMPTS_PER_SECOND = Unit(
374        "attemptsps", "attempts/s", 1, 1, "AttemptsPerSecond", is_rate=True
375    )
376    BATCHES = Unit("batches", "batches", 1, 1, "Batches")
377    BATCHES_PER_SECOND = Unit(
378        "batchesps", "batches/s", 1, 1, "BatchesPerSecond", is_rate=True
379    )
380    INDEXES = Unit("indexes", "indexes", 1, 1, "Indexes")
381    INDEXES_PER_SECOND = Unit(
382        "indexesps", "indexes/s", 1, 1, "IndexesPerSecond", is_rate=True
383    )
384    LOCKS = Unit("locks", "locks", 1, 1, "Locks")
385    LOCKS_PER_SECOND = Unit("locksps", "locks/s", 1, 1, "LocksPerSecond", is_rate=True)
386    MERGES = Unit("merges", "merges", 1, 1, "Merges")
387    MERGES_PER_SECOND = Unit(
388        "mergesps", "merges/s", 1, 1, "MergesPerSecond", is_rate=True
389    )
390    CHECKPOINTS = Unit("checkpoints", "checkpoints", 1, 1, "Checkpoints")
391    CHECKPOINTS_PER_SECOND = Unit(
392        "checkpointsps", "checkpoints/s", 1, 1, "CheckpointsPerSecond", is_rate=True
393    )
394    ROWS = Unit("rows", "rows", 1, 1, "Rows")
395    ROWS_PER_SECOND = Unit("rowsps", "rows/s", 1, 1, "RowsPerSecond", is_rate=True)
396    TABLES = Unit("tables", "tables", 1, 1, "Tables")
397    TRANSACTIONS = Unit("transactions", "transactions", 1, 1, "Transactions")
398    TRANSACTIONS_PER_SECOND = Unit(
399        "transactionsps", "transactions/s", 1, 1, "TransactionsPerSecond", is_rate=True
400    )
401
402
403class Units(Enum):  # type: ignore
404    RATIO = Ratio
405    TIME = Time
406    TIME_RATE = TimeRate
407    RATE = Rate
408    DATA_SIZE = DataSize
409    DATA_RATE = DataRate
410    FREQUENCY = Frequency
411    POWER = Power
412    ENERGY = Energy
413    RESISTANCE = Resistance
414    VOLTAGE = Voltage
415    CURRENT = Current
416    CHARGE = Charge
417    TEMPERATURE = Temperature
418    ROTATION_RATE = RotationRate
419    MISC = Misc
@dataclass
class Unit:
18@dataclass
19class Unit:
20    key: str
21    label: str
22    _order: int
23    _conversion_factor: int
24    _subtype: str = ""
25    is_rate: bool = False
Unit( key: str, label: str, _order: int, _conversion_factor: int, _subtype: str = '', is_rate: bool = False)
class UnitGroup(aenum.Enum):
28class UnitGroup(Enum):  # type: ignore
29    pass

An enumeration.

class Units(aenum.Enum):
404class Units(Enum):  # type: ignore
405    RATIO = Ratio
406    TIME = Time
407    TIME_RATE = TimeRate
408    RATE = Rate
409    DATA_SIZE = DataSize
410    DATA_RATE = DataRate
411    FREQUENCY = Frequency
412    POWER = Power
413    ENERGY = Energy
414    RESISTANCE = Resistance
415    VOLTAGE = Voltage
416    CURRENT = Current
417    CHARGE = Charge
418    TEMPERATURE = Temperature
419    ROTATION_RATE = RotationRate
420    MISC = Misc

An enumeration.