blob: 99929bcf60bfb72324f7ab786006d2fdcf32182d [file] [log] [blame]
---
title: How Statistics Work
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Each application or cache server that joins the cluster can collect and archive statistical data for analyzing system performance.
<%=vars.product_name%> statistics can be enabled for a cluster, for an application, for a server, or for a region. Statistics gathered for a cluster, an application, or a cache server are saved to a file and can be archived, whereas region statistics are transient and accessible only through the API.
<a id="how_statistics_work__section_C12B3CDFF04743688BA5F8FB374899D5"></a>
Set the configuration attributes that control cluster, application, or cache statistics collection in `gfsh` or in the `gemfire.properties` configuration file. You can also collect your own application defined statistics.
When Java applications and servers join a cluster, they can be configured via the cluster configuration service to enable statistics sampling and whether to archive the statistics that are gathered.
**Note:**
<%=vars.product_name%> statistics use the Java `System.nanoTimer` for nanosecond timing. This method provides nanosecond precision, but not necessarily nanosecond accuracy. For more information, see the online Java documentation for `System.nanoTimer` for the JRE you are using with <%=vars.product_name%>.
Statistics sampling provides valuable information for ongoing system tuning and troubleshooting. Sampling statistics at the default sample rate does not impact overall cluster performance. We recommend enabling statistics sampling in production environments.