---
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 distributed system can collect and archive statistical data for analyzing system performance.

<a id="how_statistics_work__section_C12B3CDFF04743688BA5F8FB374899D5"></a>
Set the configuration attributes that control 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 distributed system, 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 (not including time-based statistics) at the default sample rate does not impact overall distributed system performance. We recommend enabling statistics sampling in production environments. We do not recommend enabling time-based statistics (configured with the enable-time-statistics property) in production environments.


