private static void writeMetricsProperties ( final XmlSerializer xmlw , final MetricsProperties metrics , final String metricsName ) throws IllegalArgumentException , IllegalStateException , IOException { Utility . assertNotNull ( "metrics.Configuration" , metrics . getMetricsLevel ( ) ) ; // Metrics xmlw . startTag ( Constants . EMPTY_STRING , metricsName ) ; // Version Utility . serializeElement ( xmlw , Constants . AnalyticsConstants . VERSION_ELEMENT , metrics . getVersion ( ) ) ; // Enabled Utility . serializeElement ( xmlw , Constants . AnalyticsConstants . ENABLED_ELEMENT , metrics . getMetricsLevel ( ) != MetricsLevel . DISABLED ? Constants . TRUE : Constants . FALSE ) ; if ( metrics . getMetricsLevel ( ) != MetricsLevel . DISABLED ) { // Include APIs Utility . serializeElement ( xmlw , Constants . AnalyticsConstants . INCLUDE_APIS_ELEMENT , metrics . getMetricsLevel ( ) == MetricsLevel . SERVICE_AND_API ? Constants . TRUE : Constants . FALSE ) ; } // Retention Policy writeRetentionPolicy ( xmlw , metrics . getRetentionIntervalInDays ( ) ) ; // end Metrics xmlw . endTag ( Constants . EMPTY_STRING , metricsName ) ; }
Writes the given metrics properties to the XMLStreamWriter .