import { Serializable } from '../serializable' ; import { StackMonitoringFields } from './stack_monitoring_fields' ; export class ClusterStats extends Serializable < StackMonitoringFields > { constructor ( fields ) { super ( fields ) ; this . fields . type = 'cluster_stats' ; this . fields [ 'license.status' ] = 'active' ; } timestamp ( timestamp ) { super . timestamp ( timestamp ) ; this . fields [ 'cluster_stats.timestamp' ] = new Date ( timestamp ) . toISOString ( ) ; return this ; } indices ( count ) { this . fields [ 'cluster_stats.indices.count' ] = count ; return this ; } }