micromegas 0.11.0__tar.gz → 0.13.0__tar.gz
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-0.13.0/PKG-INFO +120 -0
- micromegas-0.13.0/README.md +97 -0
- micromegas-0.13.0/micromegas/__init__.py +18 -0
- micromegas-0.13.0/micromegas/admin.py +227 -0
- micromegas-0.13.0/micromegas/flightsql/FlightSql_pb2.py +174 -0
- {micromegas-0.11.0 → micromegas-0.13.0}/micromegas/flightsql/__init__.py +1 -0
- micromegas-0.13.0/micromegas/flightsql/client.py +832 -0
- {micromegas-0.11.0 → micromegas-0.13.0}/micromegas/flightsql/time.py +1 -0
- micromegas-0.13.0/micromegas/perfetto.py +111 -0
- micromegas-0.13.0/micromegas/time.py +128 -0
- {micromegas-0.11.0 → micromegas-0.13.0}/pyproject.toml +8 -5
- micromegas-0.11.0/PKG-INFO +0 -251
- micromegas-0.11.0/README.md +0 -227
- micromegas-0.11.0/micromegas/__init__.py +0 -9
- micromegas-0.11.0/micromegas/flightsql/FlightSql_pb2.py +0 -166
- micromegas-0.11.0/micromegas/flightsql/client.py +0 -230
- micromegas-0.11.0/micromegas/perfetto.py +0 -198
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/android_energy_consumer_descriptor_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/android_log_constants_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/builtin_clock_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/descriptor_pb2.py +0 -62
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/gpu_counter_descriptor_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/perf_events_pb2.py +0 -46
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/protolog_common_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/sys_stats_counters_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/common/trace_stats_pb2.py +0 -48
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/android_game_intervention_list_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/android_input_event_config_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/android_log_config_pb2.py +0 -37
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/android_polled_state_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/android_sdk_sysprop_guard_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/android_system_property_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/network_trace_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/packages_list_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/pixel_modem_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/protolog_config_pb2.py +0 -41
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/surfaceflinger_layers_config_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/android/surfaceflinger_transactions_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/chrome/chrome_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/chrome/v8_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/data_source_config_pb2.py +0 -120
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/etw/etw_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/ftrace/ftrace_config_pb2.py +0 -48
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/gpu/gpu_counter_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/gpu/vulkan_memory_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/inode_file/inode_file_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/interceptor_config_pb2.py +0 -37
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/interceptors/console_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/power/android_power_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/process_stats/process_stats_config_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/profiling/heapprofd_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/profiling/java_hprof_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/profiling/perf_event_config_pb2.py +0 -43
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/statsd/atom_ids_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/statsd/statsd_tracing_config_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/sys_stats/sys_stats_config_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/system_info/system_info_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/test_config_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/trace_config_pb2.py +0 -90
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/config/track_event/track_event_config_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/android_game_intervention_list_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/android_log_pb2.py +0 -43
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/android_system_property_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/camera_event_pb2.py +0 -48
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/frame_timeline_event_pb2.py +0 -54
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/gpu_mem_event_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/graphics/rect_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/graphics_frame_event_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/initial_display_state_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/network_trace_pb2.py +0 -46
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/packages_list_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/pixel_modem_events_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/protolog_pb2.py +0 -43
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/shell_transition_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/surfaceflinger_common_pb2.py +0 -59
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/surfaceflinger_layers_pb2.py +0 -72
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/surfaceflinger_transactions_pb2.py +0 -76
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/android/winscope_extensions_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/chrome/chrome_benchmark_metadata_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/chrome/chrome_metadata_pb2.py +0 -50
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/chrome/chrome_trace_event_pb2.py +0 -56
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/chrome/chrome_trigger_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/chrome/v8_pb2.py +0 -70
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/clock_snapshot_pb2.py +0 -41
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/etw/etw_event_bundle_pb2.py +0 -37
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/etw/etw_event_pb2.py +0 -37
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/etw/etw_pb2.py +0 -48
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/extension_descriptor_pb2.py +0 -37
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/filesystem/inode_file_map_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/android_fs_pb2.py +0 -46
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/binder_pb2.py +0 -52
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/block_pb2.py +0 -72
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/cgroup_pb2.py +0 -52
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/clk_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/cma_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/compaction_pb2.py +0 -62
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/cpuhp_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/cros_ec_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/dcvsh_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/dma_fence_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/dmabuf_heap_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/dpu_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/drm_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ext4_pb2.py +0 -224
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/f2fs_pb2.py +0 -106
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/fastrpc_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/fence_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/filemap_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ftrace_event_bundle_pb2.py +0 -66
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ftrace_event_pb2.py +0 -105
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ftrace_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ftrace_stats_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/g2d_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/generic_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/google_icc_trace_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/google_irm_trace_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/gpu_mem_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/gpu_scheduler_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/hyp_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/i2c_pb2.py +0 -50
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ion_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ipi_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/irq_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/kgsl_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/kmem_pb2.py +0 -122
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/kvm_pb2.py +0 -106
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/lowmemorykiller_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/lwis_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/mali_pb2.py +0 -98
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/mdss_pb2.py +0 -76
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/mm_event_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/net_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/oom_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/panel_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/perf_trace_counters_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/power_pb2.py +0 -60
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/printk_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/raw_syscalls_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/regulator_pb2.py +0 -48
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/rpm_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/samsung_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/sched_pb2.py +0 -64
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/scm_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/sde_pb2.py +0 -46
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/signal_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/skb_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/sock_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/sync_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/synthetic_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/systrace_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/task_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/tcp_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/thermal_exynos_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/thermal_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/trusty_pb2.py +0 -70
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/ufs_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/v4l2_pb2.py +0 -46
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/virtio_gpu_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/virtio_video_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/vmscan_pb2.py +0 -46
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ftrace/workqueue_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/gpu/gpu_counter_event_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/gpu/gpu_log_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/gpu/gpu_render_stage_event_pb2.py +0 -58
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/gpu/vulkan_api_event_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/gpu/vulkan_memory_event_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/interned_data/interned_data_pb2.py +0 -45
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/memory_graph_pb2.py +0 -48
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/perfetto/perfetto_metatrace_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/perfetto/tracing_service_event_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/power/android_energy_estimation_breakdown_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/power/android_entity_state_residency_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/power/battery_counters_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/power/power_rails_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/profiling/deobfuscation_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/profiling/heap_graph_pb2.py +0 -57
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/profiling/profile_common_pb2.py +0 -50
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/profiling/profile_packet_pb2.py +0 -72
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/profiling/smaps_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ps/process_stats_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ps/process_tree_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/remote_clock_sync_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/statsd/statsd_atom_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/sys_stats/sys_stats_pb2.py +0 -55
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/system_info/cpu_info_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/system_info_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/test_event_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_packet_defaults_pb2.py +0 -39
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_packet_pb2.py +0 -107
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_pb2.py +0 -37
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/trace_uuid_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_active_processes_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_application_state_info_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state_pb2.py +0 -75
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_content_settings_event_info_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_frame_reporter_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_histogram_sample_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_keyed_service_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_latency_info_pb2.py +0 -42
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_legacy_ipc_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_message_pump_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_mojo_event_info_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_process_descriptor_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_thread_descriptor_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_user_event_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/chrome_window_handle_event_info_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/counter_descriptor_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/debug_annotation_pb2.py +0 -44
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/log_message_pb2.py +0 -40
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/pixel_modem_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/process_descriptor_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/range_of_interest_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/screenshot_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/source_location_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/task_execution_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/thread_descriptor_pb2.py +0 -38
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/track_descriptor_pb2.py +0 -41
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/track_event/track_event_pb2.py +0 -74
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/translation/translation_table_pb2.py +0 -70
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/trigger_pb2.py +0 -36
- micromegas-0.11.0/micromegas/thirdparty/perfetto/protos/perfetto/trace/ui_state_pb2.py +0 -38
- micromegas-0.11.0/micromegas/time.py +0 -32
@@ -0,0 +1,120 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: micromegas
|
3
|
+
Version: 0.13.0
|
4
|
+
Summary: Python analytics client for https://github.com/madesroches/micromegas/
|
5
|
+
Author: Marc-Antoine Desroches
|
6
|
+
Author-email: madesroches@gmail.com
|
7
|
+
Requires-Python: >=3.10,<4.0
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
13
|
+
Requires-Dist: certifi (>=2025.4.26,<2026.0.0)
|
14
|
+
Requires-Dist: grpcio (>=1.69.0,<2.0.0)
|
15
|
+
Requires-Dist: numpy (>=2.2.6,<3.0.0)
|
16
|
+
Requires-Dist: pandas (>=2.2.2,<3.0.0)
|
17
|
+
Requires-Dist: protobuf (>=5.29.0,<6.0.0)
|
18
|
+
Requires-Dist: pyarrow (>=20.0.0,<21.0.0)
|
19
|
+
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
20
|
+
Requires-Dist: tqdm (>=4.66.0,<5.0.0)
|
21
|
+
Description-Content-Type: text/markdown
|
22
|
+
|
23
|
+
# Micromegas
|
24
|
+
|
25
|
+
Python analytics client for https://github.com/madesroches/micromegas/
|
26
|
+
|
27
|
+
📖 **[Complete Python API Documentation](https://madesroches.github.io/micromegas/docs/query-guide/python-api/)** - Comprehensive guide with all methods, examples, and advanced patterns
|
28
|
+
|
29
|
+
## Example usage
|
30
|
+
|
31
|
+
Query the 2 most recent log entries from the flightsql service
|
32
|
+
|
33
|
+
```python
|
34
|
+
import datetime
|
35
|
+
import micromegas
|
36
|
+
|
37
|
+
# Connect to local server
|
38
|
+
client = micromegas.connect()
|
39
|
+
sql = """
|
40
|
+
SELECT time, process_id, level, target, msg
|
41
|
+
FROM log_entries
|
42
|
+
WHERE level <= 4
|
43
|
+
AND exe LIKE '%flight%'
|
44
|
+
ORDER BY time DESC
|
45
|
+
LIMIT 2
|
46
|
+
"""
|
47
|
+
|
48
|
+
now = datetime.datetime.now(datetime.timezone.utc)
|
49
|
+
begin = now - datetime.timedelta(minutes=2)
|
50
|
+
end = now
|
51
|
+
df = client.query(sql, begin, end)
|
52
|
+
print(df)
|
53
|
+
```
|
54
|
+
|
55
|
+
| | time | process_id | level | target | msg |
|
56
|
+
|---:|:------------------------------------|:-------------------------------------|--------:|:---------------------------------------|:--------------------------------------------|
|
57
|
+
| 0 | 2024-10-03 18:17:56.087543714+00:00 | 1db06afc-1c88-47d1-81b3-f398c5f93616 | 4 | acme_telemetry::trace_middleware | response status=200 OK uri=/analytics/query |
|
58
|
+
| 1 | 2024-10-03 18:17:53.924037729+00:00 | 1db06afc-1c88-47d1-81b3-f398c5f93616 | 4 | micromegas_analytics::lakehouse::query | query sql= |
|
59
|
+
| | | | | | SELECT time, process_id, level, target, msg |
|
60
|
+
| | | | | | FROM log_entries |
|
61
|
+
| | | | | | WHERE level <= 4 |
|
62
|
+
| | | | | | AND exe LIKE '%analytics%' |
|
63
|
+
| | | | | | ORDER BY time DESC |
|
64
|
+
| | | | | | LIMIT 2 |
|
65
|
+
|
66
|
+
|
67
|
+
Query the 10 slowest top level spans in a trace within a specified time window
|
68
|
+
|
69
|
+
```python
|
70
|
+
import datetime
|
71
|
+
import micromegas
|
72
|
+
|
73
|
+
client = micromegas.connect()
|
74
|
+
|
75
|
+
# First find a stream ID
|
76
|
+
end = datetime.datetime.now(datetime.timezone.utc)
|
77
|
+
begin = end - datetime.timedelta(hours=1)
|
78
|
+
streams = client.query_streams(begin, end, limit=1)
|
79
|
+
|
80
|
+
if not streams.empty:
|
81
|
+
stream_id = streams['stream_id'].iloc[0]
|
82
|
+
|
83
|
+
sql = """
|
84
|
+
SELECT begin, end, duration, name
|
85
|
+
FROM view_instance('thread_spans', '{}')
|
86
|
+
WHERE depth=1
|
87
|
+
ORDER BY duration DESC
|
88
|
+
LIMIT 10
|
89
|
+
""".format(stream_id)
|
90
|
+
|
91
|
+
spans = client.query(sql, begin, end)
|
92
|
+
print(spans)
|
93
|
+
```
|
94
|
+
|
95
|
+
| | begin | end | duration | name |
|
96
|
+
|---:|:------------------------------------|:------------------------------------|-----------:|:------------------|
|
97
|
+
| 0 | 2024-10-03 18:00:59.308952900+00:00 | 2024-10-03 18:00:59.371890+00:00 | 62937100 | FEngineLoop::Tick |
|
98
|
+
| 1 | 2024-10-03 18:00:58.752476800+00:00 | 2024-10-03 18:00:58.784389+00:00 | 31912200 | FEngineLoop::Tick |
|
99
|
+
| 2 | 2024-10-03 18:00:58.701507300+00:00 | 2024-10-03 18:00:58.731479500+00:00 | 29972200 | FEngineLoop::Tick |
|
100
|
+
| 3 | 2024-10-03 18:00:59.766343100+00:00 | 2024-10-03 18:00:59.792513700+00:00 | 26170600 | FEngineLoop::Tick |
|
101
|
+
| 4 | 2024-10-03 18:00:59.282902100+00:00 | 2024-10-03 18:00:59.308952500+00:00 | 26050400 | FEngineLoop::Tick |
|
102
|
+
| 5 | 2024-10-03 18:00:59.816034500+00:00 | 2024-10-03 18:00:59.841376900+00:00 | 25342400 | FEngineLoop::Tick |
|
103
|
+
| 6 | 2024-10-03 18:00:58.897813100+00:00 | 2024-10-03 18:00:58.922769700+00:00 | 24956600 | FEngineLoop::Tick |
|
104
|
+
| 7 | 2024-10-03 18:00:59.860637+00:00 | 2024-10-03 18:00:59.885523700+00:00 | 24886700 | FEngineLoop::Tick |
|
105
|
+
| 8 | 2024-10-03 18:00:58.630051300+00:00 | 2024-10-03 18:00:58.654871500+00:00 | 24820200 | FEngineLoop::Tick |
|
106
|
+
| 9 | 2024-10-03 18:00:57.952279800+00:00 | 2024-10-03 18:00:57.977024+00:00 | 24744200 | FEngineLoop::Tick |
|
107
|
+
|
108
|
+
## Quick Start
|
109
|
+
|
110
|
+
For a complete getting started guide, see the [Python API Documentation](https://madesroches.github.io/micromegas/docs/query-guide/python-api/).
|
111
|
+
|
112
|
+
## Schema Reference
|
113
|
+
|
114
|
+
For complete schema information including all available tables, columns, and data types, see the [Schema Reference](https://madesroches.github.io/micromegas/docs/query-guide/schema-reference/).
|
115
|
+
|
116
|
+
## SQL Reference
|
117
|
+
|
118
|
+
The Micromegas analytics service is built on Apache DataFusion. For SQL syntax and functions, see the [Apache DataFusion SQL Reference](https://datafusion.apache.org/user-guide/sql/index.html).
|
119
|
+
|
120
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# Micromegas
|
2
|
+
|
3
|
+
Python analytics client for https://github.com/madesroches/micromegas/
|
4
|
+
|
5
|
+
📖 **[Complete Python API Documentation](https://madesroches.github.io/micromegas/docs/query-guide/python-api/)** - Comprehensive guide with all methods, examples, and advanced patterns
|
6
|
+
|
7
|
+
## Example usage
|
8
|
+
|
9
|
+
Query the 2 most recent log entries from the flightsql service
|
10
|
+
|
11
|
+
```python
|
12
|
+
import datetime
|
13
|
+
import micromegas
|
14
|
+
|
15
|
+
# Connect to local server
|
16
|
+
client = micromegas.connect()
|
17
|
+
sql = """
|
18
|
+
SELECT time, process_id, level, target, msg
|
19
|
+
FROM log_entries
|
20
|
+
WHERE level <= 4
|
21
|
+
AND exe LIKE '%flight%'
|
22
|
+
ORDER BY time DESC
|
23
|
+
LIMIT 2
|
24
|
+
"""
|
25
|
+
|
26
|
+
now = datetime.datetime.now(datetime.timezone.utc)
|
27
|
+
begin = now - datetime.timedelta(minutes=2)
|
28
|
+
end = now
|
29
|
+
df = client.query(sql, begin, end)
|
30
|
+
print(df)
|
31
|
+
```
|
32
|
+
|
33
|
+
| | time | process_id | level | target | msg |
|
34
|
+
|---:|:------------------------------------|:-------------------------------------|--------:|:---------------------------------------|:--------------------------------------------|
|
35
|
+
| 0 | 2024-10-03 18:17:56.087543714+00:00 | 1db06afc-1c88-47d1-81b3-f398c5f93616 | 4 | acme_telemetry::trace_middleware | response status=200 OK uri=/analytics/query |
|
36
|
+
| 1 | 2024-10-03 18:17:53.924037729+00:00 | 1db06afc-1c88-47d1-81b3-f398c5f93616 | 4 | micromegas_analytics::lakehouse::query | query sql= |
|
37
|
+
| | | | | | SELECT time, process_id, level, target, msg |
|
38
|
+
| | | | | | FROM log_entries |
|
39
|
+
| | | | | | WHERE level <= 4 |
|
40
|
+
| | | | | | AND exe LIKE '%analytics%' |
|
41
|
+
| | | | | | ORDER BY time DESC |
|
42
|
+
| | | | | | LIMIT 2 |
|
43
|
+
|
44
|
+
|
45
|
+
Query the 10 slowest top level spans in a trace within a specified time window
|
46
|
+
|
47
|
+
```python
|
48
|
+
import datetime
|
49
|
+
import micromegas
|
50
|
+
|
51
|
+
client = micromegas.connect()
|
52
|
+
|
53
|
+
# First find a stream ID
|
54
|
+
end = datetime.datetime.now(datetime.timezone.utc)
|
55
|
+
begin = end - datetime.timedelta(hours=1)
|
56
|
+
streams = client.query_streams(begin, end, limit=1)
|
57
|
+
|
58
|
+
if not streams.empty:
|
59
|
+
stream_id = streams['stream_id'].iloc[0]
|
60
|
+
|
61
|
+
sql = """
|
62
|
+
SELECT begin, end, duration, name
|
63
|
+
FROM view_instance('thread_spans', '{}')
|
64
|
+
WHERE depth=1
|
65
|
+
ORDER BY duration DESC
|
66
|
+
LIMIT 10
|
67
|
+
""".format(stream_id)
|
68
|
+
|
69
|
+
spans = client.query(sql, begin, end)
|
70
|
+
print(spans)
|
71
|
+
```
|
72
|
+
|
73
|
+
| | begin | end | duration | name |
|
74
|
+
|---:|:------------------------------------|:------------------------------------|-----------:|:------------------|
|
75
|
+
| 0 | 2024-10-03 18:00:59.308952900+00:00 | 2024-10-03 18:00:59.371890+00:00 | 62937100 | FEngineLoop::Tick |
|
76
|
+
| 1 | 2024-10-03 18:00:58.752476800+00:00 | 2024-10-03 18:00:58.784389+00:00 | 31912200 | FEngineLoop::Tick |
|
77
|
+
| 2 | 2024-10-03 18:00:58.701507300+00:00 | 2024-10-03 18:00:58.731479500+00:00 | 29972200 | FEngineLoop::Tick |
|
78
|
+
| 3 | 2024-10-03 18:00:59.766343100+00:00 | 2024-10-03 18:00:59.792513700+00:00 | 26170600 | FEngineLoop::Tick |
|
79
|
+
| 4 | 2024-10-03 18:00:59.282902100+00:00 | 2024-10-03 18:00:59.308952500+00:00 | 26050400 | FEngineLoop::Tick |
|
80
|
+
| 5 | 2024-10-03 18:00:59.816034500+00:00 | 2024-10-03 18:00:59.841376900+00:00 | 25342400 | FEngineLoop::Tick |
|
81
|
+
| 6 | 2024-10-03 18:00:58.897813100+00:00 | 2024-10-03 18:00:58.922769700+00:00 | 24956600 | FEngineLoop::Tick |
|
82
|
+
| 7 | 2024-10-03 18:00:59.860637+00:00 | 2024-10-03 18:00:59.885523700+00:00 | 24886700 | FEngineLoop::Tick |
|
83
|
+
| 8 | 2024-10-03 18:00:58.630051300+00:00 | 2024-10-03 18:00:58.654871500+00:00 | 24820200 | FEngineLoop::Tick |
|
84
|
+
| 9 | 2024-10-03 18:00:57.952279800+00:00 | 2024-10-03 18:00:57.977024+00:00 | 24744200 | FEngineLoop::Tick |
|
85
|
+
|
86
|
+
## Quick Start
|
87
|
+
|
88
|
+
For a complete getting started guide, see the [Python API Documentation](https://madesroches.github.io/micromegas/docs/query-guide/python-api/).
|
89
|
+
|
90
|
+
## Schema Reference
|
91
|
+
|
92
|
+
For complete schema information including all available tables, columns, and data types, see the [Schema Reference](https://madesroches.github.io/micromegas/docs/query-guide/schema-reference/).
|
93
|
+
|
94
|
+
## SQL Reference
|
95
|
+
|
96
|
+
The Micromegas analytics service is built on Apache DataFusion. For SQL syntax and functions, see the [Apache DataFusion SQL Reference](https://datafusion.apache.org/user-guide/sql/index.html).
|
97
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import grpc
|
2
|
+
from . import time
|
3
|
+
from . import perfetto
|
4
|
+
from . import flightsql
|
5
|
+
from . import admin
|
6
|
+
|
7
|
+
|
8
|
+
def connect(preserve_dictionary=False):
|
9
|
+
"""Connect to the analytics service using default values.
|
10
|
+
|
11
|
+
Args:
|
12
|
+
preserve_dictionary (bool, optional): When True, preserve dictionary encoding in
|
13
|
+
Arrow arrays for memory efficiency. Useful when using dictionary-encoded UDFs.
|
14
|
+
Defaults to False for backward compatibility.
|
15
|
+
"""
|
16
|
+
return flightsql.client.FlightSQLClient(
|
17
|
+
"grpc://localhost:50051", preserve_dictionary=preserve_dictionary
|
18
|
+
)
|
@@ -0,0 +1,227 @@
|
|
1
|
+
"""Administrative utilities for Micromegas lakehouse management.
|
2
|
+
|
3
|
+
This module provides functions for managing schema evolution and partition lifecycle
|
4
|
+
in Micromegas lakehouse. These functions are intended for administrative use and
|
5
|
+
should be used with caution as they perform potentially destructive operations.
|
6
|
+
"""
|
7
|
+
|
8
|
+
import pandas as pd
|
9
|
+
from typing import Optional
|
10
|
+
|
11
|
+
|
12
|
+
def list_incompatible_partitions(
|
13
|
+
client, view_set_name: Optional[str] = None
|
14
|
+
) -> pd.DataFrame:
|
15
|
+
"""List partitions with schemas incompatible with current view set schemas.
|
16
|
+
|
17
|
+
This function identifies partitions that have schema versions different from
|
18
|
+
the current schema version for their view set. These incompatible partitions
|
19
|
+
are ignored during queries but take up storage space and should be
|
20
|
+
retired to free storage and enable clean schema evolution.
|
21
|
+
|
22
|
+
Args:
|
23
|
+
client: FlightSQLClient instance for executing queries.
|
24
|
+
view_set_name (str, optional): Filter results to a specific view set.
|
25
|
+
If None, returns incompatible partitions across all view sets.
|
26
|
+
|
27
|
+
Returns:
|
28
|
+
pandas.DataFrame: DataFrame with incompatible partition information containing:
|
29
|
+
- view_set_name: Name of the view set
|
30
|
+
- view_instance_id: Instance ID (e.g., process_id or 'global')
|
31
|
+
- incompatible_schema_hash: The old schema hash in the partition
|
32
|
+
- current_schema_hash: The current schema hash from ViewFactory
|
33
|
+
- partition_count: Number of incompatible partitions with this schema
|
34
|
+
- total_size_bytes: Total size in bytes of all incompatible partitions
|
35
|
+
- file_paths: Array of file paths for each incompatible partition (for precise retirement)
|
36
|
+
|
37
|
+
Example:
|
38
|
+
>>> import micromegas
|
39
|
+
>>> import micromegas.admin
|
40
|
+
>>>
|
41
|
+
>>> client = micromegas.connect()
|
42
|
+
>>>
|
43
|
+
>>> # List all incompatible partitions across all view sets
|
44
|
+
>>> incompatible = micromegas.admin.list_incompatible_partitions(client)
|
45
|
+
>>> print(f"Found {len(incompatible)} groups of incompatible partitions")
|
46
|
+
>>>
|
47
|
+
>>> # List incompatible partitions for specific view set
|
48
|
+
>>> log_incompatible = micromegas.admin.list_incompatible_partitions(client, 'log_entries')
|
49
|
+
>>> print(f"Log entries incompatible partitions: {log_incompatible['partition_count'].sum()}")
|
50
|
+
|
51
|
+
Note:
|
52
|
+
This function leverages the existing list_partitions() and list_view_sets()
|
53
|
+
UDTFs to perform server-side JOIN and aggregation for optimal performance.
|
54
|
+
Schema "hashes" are actually version numbers (e.g., [4]) not cryptographic hashes.
|
55
|
+
SQL is executed directly by DataFusion, so no SQL injection concerns.
|
56
|
+
"""
|
57
|
+
# Build view filter clause if specific view set requested
|
58
|
+
view_filter = ""
|
59
|
+
if view_set_name is not None:
|
60
|
+
view_filter = f"AND p.view_set_name = '{view_set_name}'"
|
61
|
+
|
62
|
+
# Construct SQL query with JOIN between list_partitions() and list_view_sets()
|
63
|
+
# Server-side filtering and aggregation for optimal performance
|
64
|
+
sql = f"""
|
65
|
+
SELECT
|
66
|
+
p.view_set_name,
|
67
|
+
p.view_instance_id,
|
68
|
+
p.file_schema_hash as incompatible_schema_hash,
|
69
|
+
vs.current_schema_hash,
|
70
|
+
COUNT(*) as partition_count,
|
71
|
+
SUM(p.file_size) as total_size_bytes,
|
72
|
+
ARRAY_AGG(p.file_path) as file_paths
|
73
|
+
FROM list_partitions() p
|
74
|
+
JOIN list_view_sets() vs ON p.view_set_name = vs.view_set_name
|
75
|
+
WHERE p.file_schema_hash != vs.current_schema_hash
|
76
|
+
{view_filter}
|
77
|
+
GROUP BY p.view_set_name, p.view_instance_id, p.file_schema_hash, vs.current_schema_hash
|
78
|
+
ORDER BY p.view_set_name, p.view_instance_id
|
79
|
+
"""
|
80
|
+
|
81
|
+
return client.query(sql)
|
82
|
+
|
83
|
+
|
84
|
+
def retire_incompatible_partitions(
|
85
|
+
client, view_set_name: Optional[str] = None
|
86
|
+
) -> pd.DataFrame:
|
87
|
+
"""Retire partitions with schemas incompatible with current view set schemas.
|
88
|
+
|
89
|
+
This function identifies and retires partitions that have schema versions
|
90
|
+
different from the current schema version for their view set. This enables
|
91
|
+
safe schema evolution by cleaning up old schema versions.
|
92
|
+
|
93
|
+
**SAFETY**: This function retires only the exact incompatible partitions by
|
94
|
+
their file paths, ensuring no compatible partitions are accidentally retired.
|
95
|
+
|
96
|
+
**WARNING**: This operation is irreversible. Retired partitions will be
|
97
|
+
permanently deleted from metadata and their data files removed from object storage.
|
98
|
+
|
99
|
+
Args:
|
100
|
+
client: FlightSQLClient instance for executing queries.
|
101
|
+
view_set_name (str, optional): Retire incompatible partitions only for
|
102
|
+
this specific view set. If None, retires incompatible partitions
|
103
|
+
across all view sets (use with extreme caution).
|
104
|
+
|
105
|
+
Returns:
|
106
|
+
pandas.DataFrame: DataFrame with retirement results containing:
|
107
|
+
- view_set_name: View set that was processed
|
108
|
+
- view_instance_id: Instance ID of partitions retired
|
109
|
+
- partitions_retired: Count of partitions successfully retired
|
110
|
+
- partitions_failed: Count of partitions that failed to retire
|
111
|
+
- storage_freed_bytes: Total bytes freed from storage
|
112
|
+
- retirement_messages: Array of detailed messages for each retirement attempt
|
113
|
+
|
114
|
+
Example:
|
115
|
+
>>> import micromegas
|
116
|
+
>>> import micromegas.admin
|
117
|
+
>>>
|
118
|
+
>>> client = micromegas.connect()
|
119
|
+
>>>
|
120
|
+
>>> # Preview what would be retired (recommended first step)
|
121
|
+
>>> preview = micromegas.admin.list_incompatible_partitions(client, 'log_entries')
|
122
|
+
>>> print(f"Would retire {preview['partition_count'].sum()} partitions")
|
123
|
+
>>> print(f"Would free {preview['total_size_bytes'].sum() / (1024**3):.2f} GB")
|
124
|
+
>>>
|
125
|
+
>>> # Retire incompatible partitions for specific view set
|
126
|
+
>>> if input("Proceed with retirement? (yes/no): ") == "yes":
|
127
|
+
... result = micromegas.admin.retire_incompatible_partitions(client, 'log_entries')
|
128
|
+
... print(f"Retired {result['partitions_retired'].sum()} partitions")
|
129
|
+
... print(f"Failed {result['partitions_failed'].sum()} partitions")
|
130
|
+
|
131
|
+
Note:
|
132
|
+
This function uses the retire_partition_by_file() UDF to retire each
|
133
|
+
partition individually by its exact file path. This ensures precise
|
134
|
+
targeting and eliminates the risk of accidentally retiring compatible
|
135
|
+
partitions that happen to exist in the same time ranges.
|
136
|
+
"""
|
137
|
+
# First identify incompatible partitions
|
138
|
+
incompatible = list_incompatible_partitions(client, view_set_name)
|
139
|
+
|
140
|
+
if incompatible.empty:
|
141
|
+
# No incompatible partitions found, return empty DataFrame with expected columns
|
142
|
+
return pd.DataFrame(
|
143
|
+
columns=[
|
144
|
+
"view_set_name",
|
145
|
+
"view_instance_id",
|
146
|
+
"partitions_retired",
|
147
|
+
"partitions_failed",
|
148
|
+
"storage_freed_bytes",
|
149
|
+
"retirement_messages",
|
150
|
+
]
|
151
|
+
)
|
152
|
+
|
153
|
+
results = []
|
154
|
+
|
155
|
+
# For each group of incompatible partitions, retire by individual file paths
|
156
|
+
for _, group in incompatible.iterrows():
|
157
|
+
file_paths = group["file_paths"]
|
158
|
+
|
159
|
+
# Convert file_paths to list if it's not already (handle different pandas array types)
|
160
|
+
if hasattr(file_paths, "tolist"):
|
161
|
+
file_paths_list = file_paths.tolist()
|
162
|
+
elif isinstance(file_paths, str):
|
163
|
+
# Single file path case
|
164
|
+
file_paths_list = [file_paths]
|
165
|
+
else:
|
166
|
+
file_paths_list = list(file_paths)
|
167
|
+
|
168
|
+
retirement_messages = []
|
169
|
+
partitions_retired = 0
|
170
|
+
partitions_failed = 0
|
171
|
+
|
172
|
+
# Retire each partition individually using the targeted UDF
|
173
|
+
for file_path in file_paths_list:
|
174
|
+
if not file_path or pd.isna(file_path):
|
175
|
+
continue
|
176
|
+
|
177
|
+
try:
|
178
|
+
# Use the new retire_partition_by_file UDF
|
179
|
+
retirement_sql = (
|
180
|
+
f"SELECT retire_partition_by_file('{file_path}') as message"
|
181
|
+
)
|
182
|
+
retirement_result = client.query(retirement_sql)
|
183
|
+
|
184
|
+
if not retirement_result.empty:
|
185
|
+
message = retirement_result["message"].iloc[0]
|
186
|
+
retirement_messages.append(message)
|
187
|
+
|
188
|
+
if message.startswith("SUCCESS:"):
|
189
|
+
partitions_retired += 1
|
190
|
+
else:
|
191
|
+
partitions_failed += 1
|
192
|
+
print(f"Warning: Failed to retire {file_path}: {message}")
|
193
|
+
else:
|
194
|
+
partitions_failed += 1
|
195
|
+
retirement_messages.append(
|
196
|
+
f"ERROR: No result returned for {file_path}"
|
197
|
+
)
|
198
|
+
|
199
|
+
except Exception as e:
|
200
|
+
partitions_failed += 1
|
201
|
+
error_msg = f"ERROR: Exception retiring {file_path}: {e}"
|
202
|
+
retirement_messages.append(error_msg)
|
203
|
+
print(f"Error retiring partition {file_path}: {e}")
|
204
|
+
|
205
|
+
# Calculate storage freed (only count successful retirements)
|
206
|
+
if partitions_retired > 0 and group["partition_count"] > 0:
|
207
|
+
# Proportional calculation based on successful retirements
|
208
|
+
storage_freed = int(
|
209
|
+
group["total_size_bytes"]
|
210
|
+
* (partitions_retired / group["partition_count"])
|
211
|
+
)
|
212
|
+
else:
|
213
|
+
storage_freed = 0
|
214
|
+
|
215
|
+
# Record retirement results for this group
|
216
|
+
results.append(
|
217
|
+
{
|
218
|
+
"view_set_name": group["view_set_name"],
|
219
|
+
"view_instance_id": group["view_instance_id"],
|
220
|
+
"partitions_retired": partitions_retired,
|
221
|
+
"partitions_failed": partitions_failed,
|
222
|
+
"storage_freed_bytes": storage_freed,
|
223
|
+
"retirement_messages": retirement_messages,
|
224
|
+
}
|
225
|
+
)
|
226
|
+
|
227
|
+
return pd.DataFrame(results)
|