micromegas 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
micromegas/client.py CHANGED
@@ -15,6 +15,13 @@ class Client:
15
15
  headers=self.headers,
16
16
  )
17
17
 
18
+ def find_stream(self, stream_id):
19
+ return request.request(
20
+ self.analytics_base_url + "find_stream",
21
+ {"stream_id": stream_id},
22
+ headers=self.headers,
23
+ )
24
+
18
25
  def query_processes(self, begin, end, limit):
19
26
  return request.request(
20
27
  self.analytics_base_url + "query_processes",
@@ -145,19 +152,7 @@ class Client:
145
152
  except cbor2.CBORDecodeEOF:
146
153
  break
147
154
 
148
- def create_or_update_partitions(
149
- self, view_set_name, view_instance_id, begin, end, partition_delta_seconds
150
- ):
151
- args = {
152
- "view_set_name": view_set_name,
153
- "view_instance_id": view_instance_id,
154
- "begin": time.format_datetime(begin),
155
- "end": time.format_datetime(end),
156
- "partition_delta_seconds": partition_delta_seconds,
157
- }
158
- self.__stream_request("create_or_update_partitions", args)
159
-
160
- def merge_partitions(
155
+ def materialize_partitions(
161
156
  self, view_set_name, view_instance_id, begin, end, partition_delta_seconds
162
157
  ):
163
158
  args = {
@@ -167,7 +162,7 @@ class Client:
167
162
  "end": time.format_datetime(end),
168
163
  "partition_delta_seconds": partition_delta_seconds,
169
164
  }
170
- self.__stream_request("merge_partitions", args)
165
+ self.__stream_request("materialize_partitions", args)
171
166
 
172
167
  def retire_partitions(
173
168
  self, view_set_name, view_instance_id, begin, end, partition_delta_seconds
micromegas/time.py CHANGED
@@ -4,15 +4,17 @@ import re
4
4
 
5
5
  def format_datetime(value):
6
6
  nonetype = type(None)
7
- match type(value):
8
- case datetime.datetime:
9
- if value.tzinfo is None:
10
- raise RuntimeError("datetime needs a valid time zone")
11
- return value.isoformat()
12
- case pandas.Timestamp:
13
- return value.isoformat()
14
- case nonetype:
15
- return None
7
+ value_type = type(value)
8
+ if value_type == datetime.datetime:
9
+ if value.tzinfo is None:
10
+ raise RuntimeError("datetime needs a valid time zone")
11
+ return value.isoformat()
12
+ elif value_type == pandas.Timestamp:
13
+ return value.isoformat()
14
+ elif value_type == str:
15
+ return format_datetime(datetime.datetime.fromisoformat(value))
16
+ elif value_type == type(None):
17
+ return None
16
18
  raise RuntimeError("value of unknown type in format_datetime")
17
19
 
18
20
  def parse_time_delta(user_string):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micromegas
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Python analytics client for https://github.com/madesroches/micromegas/
5
5
  Author: Marc-Antoine Desroches
6
6
  Author-email: madesroches@gmail.com
@@ -16,6 +16,7 @@ Requires-Dist: protobuf (>=5.27.1,<6.0.0)
16
16
  Requires-Dist: pyarrow (>=16.0.0,<17.0.0)
17
17
  Requires-Dist: requests (>=2.31.0,<3.0.0)
18
18
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
19
+ Requires-Dist: tqdm (>=4.66.5,<5.0.0)
19
20
  Description-Content-Type: text/markdown
20
21
 
21
22
  # Micromegas
@@ -1,5 +1,5 @@
1
1
  micromegas/__init__.py,sha256=E_j3LFxMk9rSMJunwDCi_90NsRHm1fKwjj_6KGMYCjQ,246
2
- micromegas/client.py,sha256=M-LrQu9wHaJiYz-1TOM06O7Smd-R4EuE_KeZDS94eoA,5973
2
+ micromegas/client.py,sha256=idKWDZhmXDiBDr8KNorQ1t-KNT-E2twoKoUy3d5-Bp8,5719
3
3
  micromegas/perfetto.py,sha256=yuIe5iKvca61aWMBQNziSGM-DHcOEsiobtKx2SsNQ3E,7829
4
4
  micromegas/request.py,sha256=NV0urom5P3_P2q94gX51hxW_Fnrp_DDRorsP3mUb5NM,941
5
5
  micromegas/thirdparty/perfetto/protos/perfetto/common/android_energy_consumer_descriptor_pb2.py,sha256=l8QNXqnB-mJIkuFr2s1YoLQXHm3G-ZcOGp_OW_hQ0TE,1887
@@ -42,7 +42,6 @@ micromegas/thirdparty/perfetto/protos/perfetto/config/statsd/atom_ids_pb2.py,sha
42
42
  micromegas/thirdparty/perfetto/protos/perfetto/config/statsd/statsd_tracing_config_pb2.py,sha256=R_5SdcZtVBBBJ6PTkYlpVCmuzzftpRR14WTYpCppFnU,2159
43
43
  micromegas/thirdparty/perfetto/protos/perfetto/config/sys_stats/sys_stats_config_pb2.py,sha256=o6erypHQHn0scqZabZwwphxRvL50AtC38UR-Pl79F-A,2561
44
44
  micromegas/thirdparty/perfetto/protos/perfetto/config/system_info/system_info_pb2.py,sha256=vzqFeZbIVX638cyk2Y7PnFBGD3ZF-0kT6K8__UV5H6Y,1397
45
- micromegas/thirdparty/perfetto/protos/perfetto/config/test_config_pb2.py,sha256=d5NO3cG-1Gsg5AvpzarJzIDQZTKwkpiAEkw8KKwNghc,2437
46
45
  micromegas/thirdparty/perfetto/protos/perfetto/config/trace_config_pb2.py,sha256=gCbplyGYzbNXbygk0_SWO1L6fP9UO5kMhxE9MDeGNFY,12753
47
46
  micromegas/thirdparty/perfetto/protos/perfetto/config/track_event/track_event_config_pb2.py,sha256=B76vM-h26uHWAmPye5qdX8G-2917FeVUPLTO4dz36tE,1907
48
47
  micromegas/thirdparty/perfetto/protos/perfetto/trace/android/android_game_intervention_list_pb2.py,sha256=o3Og8gaoY85tptvGqbhav4fDmuQu7bdFtSmrC1yaIY0,2437
@@ -171,7 +170,6 @@ micromegas/thirdparty/perfetto/protos/perfetto/trace/statsd/statsd_atom_pb2.py,s
171
170
  micromegas/thirdparty/perfetto/protos/perfetto/trace/sys_stats/sys_stats_pb2.py,sha256=mT0oYvJtTq3te7tnBWI2lVxEtxyDYZjZOehvdISEbEk,5404
172
171
  micromegas/thirdparty/perfetto/protos/perfetto/trace/system_info/cpu_info_pb2.py,sha256=jN3hh8oZeETAqzSi4wkiUaBVYgBBheYZBpK0x2f_Dis,1621
173
172
  micromegas/thirdparty/perfetto/protos/perfetto/trace/system_info_pb2.py,sha256=A7zU7AVq-9i41uxj8P0mZhoU98cRULkZmE25rRHVfF4,2017
174
- micromegas/thirdparty/perfetto/protos/perfetto/trace/test_event_pb2.py,sha256=ovbLi6_TS0MC-P685D_gxJcm4zxeGTyLWK87HW5tGJM,2293
175
173
  micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_packet_defaults_pb2.py,sha256=ENsJNaUGaFIkpUpcZa7t-Ue72GhdH0pJw0FrUnfKMng,2250
176
174
  micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_packet_pb2.py,sha256=5hkSMh_D0J2UCnm7K2CfIQQtDoAtD9yNDoNNiVLQrLA,21973
177
175
  micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_pb2.py,sha256=ZC7Dal05CR77mENj53oy-AXbcfSQL29NT9H4_PgFGG8,1509
@@ -207,7 +205,7 @@ micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/track_event_pb2
207
205
  micromegas/thirdparty/perfetto/protos/perfetto/trace/translation/translation_table_pb2.py,sha256=-hkUdv07TsSDHH1mier2KyAhmivK4GSzEfAzAEYv20U,6630
208
206
  micromegas/thirdparty/perfetto/protos/perfetto/trace/trigger_pb2.py,sha256=We7Yi8o3cEcrSNxY1zLUUO6tEWnD36C2f3O_s8_qv0I,1435
209
207
  micromegas/thirdparty/perfetto/protos/perfetto/trace/ui_state_pb2.py,sha256=Af-SXwhroNhRXMrtw6e2eU1liCImMRxSdmkt_AuSHf8,1752
210
- micromegas/time.py,sha256=teMWk_hniW2jI7MWJ2w0HuckdTiebdr35-snUz_3cfU,911
211
- micromegas-0.1.6.dist-info/METADATA,sha256=yZywCrAstjiI57lhWaTOTaCHE3MfqlCuaG0bASmgcCM,839
212
- micromegas-0.1.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
213
- micromegas-0.1.6.dist-info/RECORD,,
208
+ micromegas/time.py,sha256=eD9fWF2UHxaf-92yd1X2SEgUcpKypqPsvjBosLdpnQA,1026
209
+ micromegas-0.1.8.dist-info/METADATA,sha256=uToo9un_nwI0sqJXfyIiGCDk92jg3X-cYK3j6pU4lNc,877
210
+ micromegas-0.1.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
211
+ micromegas-0.1.8.dist-info/RECORD,,
@@ -1,38 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
- # source: protos/perfetto/config/test_config.proto
5
- # Protobuf Python Version: 5.27.1
6
- """Generated protocol buffer code."""
7
- from google.protobuf import descriptor as _descriptor
8
- from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
- from google.protobuf import symbol_database as _symbol_database
11
- from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 5,
15
- 27,
16
- 1,
17
- '',
18
- 'protos/perfetto/config/test_config.proto'
19
- )
20
- # @@protoc_insertion_point(imports)
21
-
22
- _sym_db = _symbol_database.Default()
23
-
24
-
25
-
26
-
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(protos/perfetto/config/test_config.proto\x12\x0fperfetto.protos\"\x8d\x04\n\nTestConfig\x12\x15\n\rmessage_count\x18\x01 \x01(\r\x12\x1f\n\x17max_messages_per_second\x18\x02 \x01(\r\x12\x0c\n\x04seed\x18\x03 \x01(\r\x12\x14\n\x0cmessage_size\x18\x04 \x01(\r\x12\x1e\n\x16send_batch_on_register\x18\x05 \x01(\x08\x12=\n\x0c\x64ummy_fields\x18\x06 \x01(\x0b\x32\'.perfetto.protos.TestConfig.DummyFields\x1a\xc3\x02\n\x0b\x44ummyFields\x12\x14\n\x0c\x66ield_uint32\x18\x01 \x01(\r\x12\x13\n\x0b\x66ield_int32\x18\x02 \x01(\x05\x12\x14\n\x0c\x66ield_uint64\x18\x03 \x01(\x04\x12\x13\n\x0b\x66ield_int64\x18\x04 \x01(\x03\x12\x15\n\rfield_fixed64\x18\x05 \x01(\x06\x12\x16\n\x0e\x66ield_sfixed64\x18\x06 \x01(\x10\x12\x15\n\rfield_fixed32\x18\x07 \x01(\x07\x12\x16\n\x0e\x66ield_sfixed32\x18\x08 \x01(\x0f\x12\x14\n\x0c\x66ield_double\x18\t \x01(\x01\x12\x13\n\x0b\x66ield_float\x18\n \x01(\x02\x12\x14\n\x0c\x66ield_sint64\x18\x0b \x01(\x12\x12\x14\n\x0c\x66ield_sint32\x18\x0c \x01(\x11\x12\x14\n\x0c\x66ield_string\x18\r \x01(\t\x12\x13\n\x0b\x66ield_bytes\x18\x0e \x01(\x0c')
28
-
29
- _globals = globals()
30
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protos.perfetto.config.test_config_pb2', _globals)
32
- if not _descriptor._USE_C_DESCRIPTORS:
33
- DESCRIPTOR._loaded_options = None
34
- _globals['_TESTCONFIG']._serialized_start=62
35
- _globals['_TESTCONFIG']._serialized_end=587
36
- _globals['_TESTCONFIG_DUMMYFIELDS']._serialized_start=264
37
- _globals['_TESTCONFIG_DUMMYFIELDS']._serialized_end=587
38
- # @@protoc_insertion_point(module_scope)
@@ -1,39 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
- # source: protos/perfetto/trace/test_event.proto
5
- # Protobuf Python Version: 5.27.1
6
- """Generated protocol buffer code."""
7
- from google.protobuf import descriptor as _descriptor
8
- from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
- from google.protobuf import symbol_database as _symbol_database
11
- from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 5,
15
- 27,
16
- 1,
17
- '',
18
- 'protos/perfetto/trace/test_event.proto'
19
- )
20
- # @@protoc_insertion_point(imports)
21
-
22
- _sym_db = _symbol_database.Default()
23
-
24
-
25
- from protos.perfetto.trace.track_event import debug_annotation_pb2 as protos_dot_perfetto_dot_trace_dot_track__event_dot_debug__annotation__pb2
26
-
27
-
28
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&protos/perfetto/trace/test_event.proto\x12\x0fperfetto.protos\x1a\x38protos/perfetto/trace/track_event/debug_annotation.proto\"\xfb\x02\n\tTestEvent\x12\x0b\n\x03str\x18\x01 \x01(\t\x12\x11\n\tseq_value\x18\x02 \x01(\r\x12\x0f\n\x07\x63ounter\x18\x03 \x01(\x04\x12\x0f\n\x07is_last\x18\x04 \x01(\x08\x12\x37\n\x07payload\x18\x05 \x01(\x0b\x32&.perfetto.protos.TestEvent.TestPayload\x1a\xf2\x01\n\x0bTestPayload\x12\x0b\n\x03str\x18\x01 \x03(\t\x12\x36\n\x06nested\x18\x02 \x03(\x0b\x32&.perfetto.protos.TestEvent.TestPayload\x12\x15\n\rsingle_string\x18\x04 \x01(\t\x12\x12\n\nsingle_int\x18\x05 \x01(\x05\x12\x15\n\rrepeated_ints\x18\x06 \x03(\x05\x12\x1f\n\x17remaining_nesting_depth\x18\x03 \x01(\r\x12;\n\x11\x64\x65\x62ug_annotations\x18\x07 \x03(\x0b\x32 .perfetto.protos.DebugAnnotation')
29
-
30
- _globals = globals()
31
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protos.perfetto.trace.test_event_pb2', _globals)
33
- if not _descriptor._USE_C_DESCRIPTORS:
34
- DESCRIPTOR._loaded_options = None
35
- _globals['_TESTEVENT']._serialized_start=118
36
- _globals['_TESTEVENT']._serialized_end=497
37
- _globals['_TESTEVENT_TESTPAYLOAD']._serialized_start=255
38
- _globals['_TESTEVENT_TESTPAYLOAD']._serialized_end=497
39
- # @@protoc_insertion_point(module_scope)