import { getStats , VisualizationUsage } from './get_usage_collector' ; import type { UsageCollectionSetup } from '../../../usage_collection/server' ; export function registerVisualizationsCollector ( collectorSet ) { const collector = collectorSet . makeUsageCollector < VisualizationUsage | undefined > ( { type : 'visualization_types' , isReady : ( ) => true , schema : { DYNAMIC_KEY : { total : { type : 'long' } , spaces_min : { type : 'long' } , spaces_max : { type : 'long' } , spaces_avg : { type : 'long' } , saved_7_days_total : { type : 'long' } , saved_30_days_total : { type : 'long' } , saved_90_days_total : { type : 'long' } , } , } , fetch : async ( { soClient } ) => await getStats ( soClient ) , } ) ; collectorSet . registerCollector ( collector ) ; }