/*
 * 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.
 */
package org.apache.geode.cache.client.internal;

import org.apache.geode.StatisticDescriptor;
import org.apache.geode.Statistics;
import org.apache.geode.StatisticsFactory;
import org.apache.geode.StatisticsType;
import org.apache.geode.StatisticsTypeFactory;
import org.apache.geode.annotations.Immutable;
import org.apache.geode.annotations.VisibleForTesting;
import org.apache.geode.distributed.internal.DistributionStats;
import org.apache.geode.internal.cache.PoolStats;
import org.apache.geode.internal.cache.tier.sockets.MessageStats;
import org.apache.geode.internal.statistics.StatisticsTypeFactoryImpl;

/**
 * Stats for a client to server {@link Connection}
 *
 * @since GemFire 5.7
 */
public class ConnectionStats implements MessageStats {
  // static fields
  @Immutable
  private static final StatisticsType type;
  @Immutable
  private static final StatisticsType sendType;

  @VisibleForTesting
  static StatisticsType getType() {
    return type;
  }

  @VisibleForTesting
  static StatisticsType getSendType() {
    return sendType;
  }

  private static final int getInProgressId;
  private static final int getSendInProgressId;
  private static final int getSendFailedId;
  private static final int getSendId;
  private static final int getSendDurationId;
  private static final int getTimedOutId;
  private static final int getFailedId;
  private static final int getId;
  private static final int getDurationId;

  private static final int putInProgressId;
  private static final int putSendInProgressId;
  private static final int putSendFailedId;
  private static final int putSendId;
  private static final int putSendDurationId;
  private static final int putTimedOutId;
  private static final int putFailedId;
  private static final int putId;
  private static final int putDurationId;

  private static final int destroyInProgressId;
  private static final int destroySendInProgressId;
  private static final int destroySendFailedId;
  private static final int destroySendId;
  private static final int destroySendDurationId;
  private static final int destroyTimedOutId;
  private static final int destroyFailedId;
  private static final int destroyId;
  private static final int destroyDurationId;

  private static final int destroyRegionInProgressId;
  private static final int destroyRegionSendInProgressId;
  private static final int destroyRegionSendFailedId;
  private static final int destroyRegionSendId;
  private static final int destroyRegionSendDurationId;
  private static final int destroyRegionTimedOutId;
  private static final int destroyRegionFailedId;
  private static final int destroyRegionId;
  private static final int destroyRegionDurationId;

  private static final int clearInProgressId;
  private static final int clearSendInProgressId;
  private static final int clearSendFailedId;
  private static final int clearSendId;
  private static final int clearSendDurationId;
  private static final int clearTimedOutId;
  private static final int clearFailedId;
  private static final int clearId;
  private static final int clearDurationId;

  private static final int containsKeyInProgressId;
  private static final int containsKeySendInProgressId;
  private static final int containsKeySendFailedId;
  private static final int containsKeySendId;
  private static final int containsKeySendDurationId;
  private static final int containsKeyTimedOutId;
  private static final int containsKeyFailedId;
  private static final int containsKeyId;
  private static final int containsKeyDurationId;

  private static final int keySetInProgressId;
  private static final int keySetSendInProgressId;
  private static final int keySetSendFailedId;
  private static final int keySetSendId;
  private static final int keySetSendDurationId;
  private static final int keySetTimedOutId;
  private static final int keySetFailedId;
  private static final int keySetId;
  private static final int keySetDurationId;

  private static final int commitInProgressId;
  private static final int commitSendInProgressId;
  private static final int commitSendFailedId;
  private static final int commitSendId;
  private static final int commitSendDurationId;

  private static final int commitFailedId;
  private static final int commitTimedOutId;
  private static final int commitId;
  private static final int commitDurationId;

  private static final int rollbackInProgressId;
  private static final int rollbackSendInProgressId;
  private static final int rollbackSendFailedId;
  private static final int rollbackSendId;
  private static final int rollbackSendDurationId;

  private static final int rollbackFailedId;
  private static final int rollbackTimedOutId;
  private static final int rollbackId;
  private static final int rollbackDurationId;

  private static final int getEntryInProgressId;
  private static final int getEntrySendInProgressId;
  private static final int getEntrySendFailedId;
  private static final int getEntrySendId;
  private static final int getEntrySendDurationId;

  private static final int getEntryFailedId;
  private static final int getEntryTimedOutId;
  private static final int getEntryId;
  private static final int getEntryDurationId;

  private static final int txSynchronizationInProgressId;
  private static final int txSynchronizationSendInProgressId;
  private static final int txSynchronizationSendFailedId;
  private static final int txSynchronizationSendId;
  private static final int txSynchronizationSendDurationId;

  private static final int txSynchronizationFailedId;
  private static final int txSynchronizationTimedOutId;
  private static final int txSynchronizationId;
  private static final int txSynchronizationDurationId;

  private static final int txFailoverInProgressId;
  private static final int txFailoverSendInProgressId;
  private static final int txFailoverSendFailedId;
  private static final int txFailoverSendId;
  private static final int txFailoverSendDurationId;

  private static final int txFailoverFailedId;
  private static final int txFailoverTimedOutId;
  private static final int txFailoverId;
  private static final int txFailoverDurationId;

  private static final int sizeInProgressId;
  private static final int sizeSendInProgressId;
  private static final int sizeSendFailedId;
  private static final int sizeSendId;
  private static final int sizeSendDurationId;

  private static final int sizeFailedId;
  private static final int sizeTimedOutId;
  private static final int sizeId;
  private static final int sizeDurationId;

  private static final int invalidateInProgressId;
  private static final int invalidateSendInProgressId;
  private static final int invalidateSendFailedId;
  private static final int invalidateSendId;
  private static final int invalidateSendDurationId;

  private static final int invalidateFailedId;
  private static final int invalidateTimedOutId;
  private static final int invalidateId;
  private static final int invalidateDurationId;


  private static final int registerInterestInProgressId;
  private static final int registerInterestSendInProgressId;
  private static final int registerInterestSendFailedId;
  private static final int registerInterestSendId;
  private static final int registerInterestSendDurationId;
  private static final int registerInterestTimedOutId;
  private static final int registerInterestFailedId;
  private static final int registerInterestId;
  private static final int registerInterestDurationId;

  private static final int unregisterInterestInProgressId;
  private static final int unregisterInterestSendInProgressId;
  private static final int unregisterInterestSendFailedId;
  private static final int unregisterInterestSendId;
  private static final int unregisterInterestSendDurationId;
  private static final int unregisterInterestTimedOutId;
  private static final int unregisterInterestFailedId;
  private static final int unregisterInterestId;
  private static final int unregisterInterestDurationId;

  private static final int queryInProgressId;
  private static final int querySendInProgressId;
  private static final int querySendFailedId;
  private static final int querySendId;
  private static final int querySendDurationId;
  private static final int queryTimedOutId;
  private static final int queryFailedId;
  private static final int queryId;
  private static final int queryDurationId;

  private static final int createCQInProgressId;
  private static final int createCQSendInProgressId;
  private static final int createCQSendFailedId;
  private static final int createCQSendId;
  private static final int createCQSendDurationId;
  private static final int createCQTimedOutId;
  private static final int createCQFailedId;
  private static final int createCQId;
  private static final int createCQDurationId;
  private static final int stopCQInProgressId;
  private static final int stopCQSendInProgressId;
  private static final int stopCQSendFailedId;
  private static final int stopCQSendId;
  private static final int stopCQSendDurationId;
  private static final int stopCQTimedOutId;
  private static final int stopCQFailedId;
  private static final int stopCQId;
  private static final int stopCQDurationId;
  private static final int closeCQInProgressId;
  private static final int closeCQSendInProgressId;
  private static final int closeCQSendFailedId;
  private static final int closeCQSendId;
  private static final int closeCQSendDurationId;
  private static final int closeCQTimedOutId;
  private static final int closeCQFailedId;
  private static final int closeCQId;
  private static final int closeCQDurationId;
  private static final int gatewayBatchInProgressId;
  private static final int gatewayBatchSendInProgressId;
  private static final int gatewayBatchSendFailedId;
  private static final int gatewayBatchSendId;
  private static final int gatewayBatchSendDurationId;
  private static final int gatewayBatchTimedOutId;
  private static final int gatewayBatchFailedId;
  private static final int gatewayBatchId;
  private static final int gatewayBatchDurationId;
  private static final int getDurableCQsInProgressId;
  private static final int getDurableCQsSendsInProgressId;
  private static final int getDurableCQsSendFailedId;
  private static final int getDurableCQsSendId;
  private static final int getDurableCQsSendDurationId;
  private static final int getDurableCQsTimedOutId;
  private static final int getDurableCQsFailedId;
  private static final int getDurableCQsId;
  private static final int getDurableCQsDurationId;

  private static final int readyForEventsInProgressId;
  private static final int readyForEventsSendInProgressId;
  private static final int readyForEventsSendFailedId;
  private static final int readyForEventsSendId;
  private static final int readyForEventsSendDurationId;
  private static final int readyForEventsTimedOutId;
  private static final int readyForEventsFailedId;
  private static final int readyForEventsId;
  private static final int readyForEventsDurationId;

  private static final int makePrimaryInProgressId;
  private static final int makePrimarySendInProgressId;
  private static final int makePrimarySendFailedId;
  private static final int makePrimarySendId;
  private static final int makePrimarySendDurationId;
  private static final int makePrimaryTimedOutId;
  private static final int makePrimaryFailedId;
  private static final int makePrimaryId;
  private static final int makePrimaryDurationId;

  private static final int closeConInProgressId;
  private static final int closeConSendInProgressId;
  private static final int closeConSendFailedId;
  private static final int closeConSendId;
  private static final int closeConSendDurationId;
  private static final int closeConTimedOutId;
  private static final int closeConFailedId;
  private static final int closeConId;
  private static final int closeConDurationId;

  private static final int primaryAckInProgressId;
  private static final int primaryAckSendInProgressId;
  private static final int primaryAckSendFailedId;
  private static final int primaryAckSendId;
  private static final int primaryAckSendDurationId;
  private static final int primaryAckTimedOutId;
  private static final int primaryAckFailedId;
  private static final int primaryAckId;
  private static final int primaryAckDurationId;

  private static final int pingInProgressId;
  private static final int pingSendInProgressId;
  private static final int pingSendFailedId;
  private static final int pingSendId;
  private static final int pingSendDurationId;
  private static final int pingTimedOutId;
  private static final int pingFailedId;
  private static final int pingId;
  private static final int pingDurationId;

  private static final int registerInstantiatorsInProgressId;
  private static final int registerInstantiatorsSendInProgressId;
  private static final int registerInstantiatorsSendFailedId;
  private static final int registerInstantiatorsSendId;
  private static final int registerInstantiatorsSendDurationId;
  private static final int registerInstantiatorsTimedOutId;
  private static final int registerInstantiatorsFailedId;
  private static final int registerInstantiatorsId;
  private static final int registerInstantiatorsDurationId;

  private static final int registerDataSerializersInProgressId;
  private static final int registerDataSerializersSendInProgressId;
  private static final int registerDataSerializersSendFailedId;
  private static final int registerDataSerializersSendId;
  private static final int registerDataSerializersSendDurationId;
  private static final int registerDataSerializersTimedOutId;
  private static final int registerDataSerializersFailedId;
  private static final int registerDataSerializersId;
  private static final int registerDataSerializersDurationId;

  private static final int putAllInProgressId;
  private static final int putAllSendInProgressId;
  private static final int putAllSendFailedId;
  private static final int putAllSendId;
  private static final int putAllSendDurationId;
  private static final int putAllTimedOutId;
  private static final int putAllFailedId;
  private static final int putAllId;
  private static final int putAllDurationId;

  private static final int removeAllInProgressId;
  private static final int removeAllSendInProgressId;
  private static final int removeAllSendFailedId;
  private static final int removeAllSendId;
  private static final int removeAllSendDurationId;
  private static final int removeAllTimedOutId;
  private static final int removeAllFailedId;
  private static final int removeAllId;
  private static final int removeAllDurationId;

  private static final int getAllInProgressId;
  private static final int getAllSendInProgressId;
  private static final int getAllSendFailedId;
  private static final int getAllSendId;
  private static final int getAllSendDurationId;
  private static final int getAllTimedOutId;
  private static final int getAllFailedId;
  private static final int getAllId;
  private static final int getAllDurationId;

  private static final int connectionsId;
  private static final int connectsId;
  private static final int disconnectsId;
  private static final int messagesBeingReceivedId;
  private static final int messageBytesBeingReceivedId;
  private static final int receivedBytesId;
  private static final int sentBytesId;

  private static final int executeFunctionInProgressId;
  private static final int executeFunctionSendInProgressId;
  private static final int executeFunctionSendFailedId;
  private static final int executeFunctionSendId;
  private static final int executeFunctionSendDurationId;
  private static final int executeFunctionTimedOutId;
  private static final int executeFunctionFailedId;
  private static final int executeFunctionId;
  private static final int executeFunctionDurationId;

  private static final int getClientPRMetadataInProgressId;
  private static final int getClientPRMetadataSendInProgressId;
  private static final int getClientPRMetadataSendFailedId;
  private static final int getClientPRMetadataSendId;
  private static final int getClientPRMetadataSendDurationId;
  private static final int getClientPRMetadataTimedOutId;
  private static final int getClientPRMetadataFailedId;
  private static final int getClientPRMetadataId;
  private static final int getClientPRMetadataDurationId;

  private static final int getClientPartitionAttributesInProgressId;
  private static final int getClientPartitionAttributesSendInProgressId;
  private static final int getClientPartitionAttributesSendFailedId;
  private static final int getClientPartitionAttributesSendId;
  private static final int getClientPartitionAttributesSendDurationId;
  private static final int getClientPartitionAttributesTimedOutId;
  private static final int getClientPartitionAttributesFailedId;
  private static final int getClientPartitionAttributesId;
  private static final int getClientPartitionAttributesDurationId;

  private static final int getPDXIdForTypeInProgressId;
  private static final int getPDXIdForTypeSendInProgressId;
  private static final int getPDXIdForTypeSendFailedId;
  private static final int getPDXIdForTypeSendId;
  private static final int getPDXIdForTypeSendDurationId;
  private static final int getPDXIdForTypeTimedOutId;
  private static final int getPDXIdForTypeFailedId;
  private static final int getPDXIdForTypeId;
  private static final int getPDXIdForTypeDurationId;

  private static final int getPDXTypeByIdInProgressId;
  private static final int getPDXTypeByIdSendInProgressId;
  private static final int getPDXTypeByIdSendFailedId;
  private static final int getPDXTypeByIdSendId;
  private static final int getPDXTypeByIdSendDurationId;
  private static final int getPDXTypeByIdTimedOutId;
  private static final int getPDXTypeByIdFailedId;
  private static final int getPDXTypeByIdId;
  private static final int getPDXTypeByIdDurationId;

  private static final int addPdxTypeInProgressId;
  private static final int addPdxTypeSendInProgressId;
  private static final int addPdxTypeSendFailedId;
  private static final int addPdxTypeSendId;
  private static final int addPdxTypeSendDurationId;
  private static final int addPdxTypeTimedOutId;
  private static final int addPdxTypeFailedId;
  private static final int addPdxTypeId;
  private static final int addPdxTypeDurationId;


  // An array of all of the ids that represent operation statistics. This
  // is used by the getOps method to aggregate the individual stats
  // into a total value for all operations.
  @Immutable
  private static final int[] opIds;

  static {
    try {
      StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
      type = f.createType("ClientStats", "Statistics about client to server communication",
          new StatisticDescriptor[] {
              f.createIntGauge("addPdxTypeInProgress",
                  "Current number of addPdxType operations being executed", "addPdxType"),
              f.createIntCounter("addPdxTypeFailures",
                  "Total number of addPdxType operation attempts that have failed", "addPdxType"),
              f.createIntCounter("addPdxTypeSuccessful",
                  "Total number of addPdxType operations completed successfully", "addPdxType"),
              f.createIntCounter("addPdxTypeTimeouts",
                  "Total number of addPdxType operation attempts that have timed out",
                  "addPdxType"),
              f.createLongCounter("addPdxTypeTime",
                  "Total amount of time, in nanoseconds spent doing addPdxType successfully/unsuccessfully.",
                  "nanoseconds"),
              f.createLongCounter("clears", "Total number of clears completed successfully",
                  "clears"),
              f.createIntGauge("clearsInProgress", "Current number of clears being executed",
                  "clears"),
              f.createLongCounter("clearFailures",
                  "Total number of clear attempts that have failed",
                  "clears"),
              f.createLongCounter("clearTimeouts",
                  "Total number of clear attempts that have timed out", "clears"),
              f.createLongCounter("clearTime",
                  "Total amount of time, in nanoseconds spent doing clears", "nanoseconds"),
              f.createIntGauge("closeConsInProgress", "Current number of closeCons being executed",
                  "closeCons"),
              f.createIntCounter("closeCons", "Total number of closeCons completed successfully",
                  "closeCons"),
              f.createIntCounter("closeConFailures",
                  "Total number of closeCon attempts that have failed", "closeCons"),
              f.createIntCounter("closeConTimeouts",
                  "Total number of closeCon attempts that have timed out", "closeCons"),
              f.createLongCounter("closeConTime",
                  "Total amount of time, in nanoseconds spent doing closeCons", "nanoseconds"),
              f.createIntGauge("closeCQsInProgress", "Current number of closeCQs being executed",
                  "closeCQs"),
              f.createIntCounter("closeCQs", "Total number of closeCQs completed successfully",
                  "closeCQs"),
              f.createIntCounter("closeCQFailures",
                  "Total number of closeCQ attempts that have failed", "closeCQs"),
              f.createIntCounter("closeCQTimeouts",
                  "Total number of closeCQ attempts that have timed out", "closeCQs"),
              f.createLongCounter("closeCQTime",
                  "Total amount of time, in nanoseconds spent doing closeCQs", "nanoseconds"),
              f.createIntGauge("createCQsInProgress", "Current number of createCQs being executed",
                  "createCQs"),
              f.createIntCounter("createCQs", "Total number of createCQs completed successfully",
                  "createCQs"),
              f.createIntCounter("createCQFailures",
                  "Total number of createCQ attempts that have failed", "createCQs"),
              f.createIntCounter("createCQTimeouts",
                  "Total number of createCQ attempts that have timed out", "createCQs"),
              f.createLongCounter("createCQTime",
                  "Total amount of time, in nanoseconds spent doing createCQs", "nanoseconds"),
              f.createIntGauge("commitsInProgress", "Current number of commits being executed",
                  "commits"),
              f.createIntCounter("commits", "Total number of commits completed successfully",
                  "commits"),
              f.createIntCounter("commitFailures",
                  "Total number of commit attempts that have failed", "commits"),
              f.createIntCounter("commitTimeouts",
                  "Total number of commit attempts that have timed out", "commits"),
              f.createLongCounter("commitTime",
                  "Total amount of time, in nanoseconds spent doing commits", "nanoseconds"),
              f.createIntGauge("containsKeysInProgress",
                  "Current number of containsKeys being executed", "containsKeys"),
              f.createIntCounter("containsKeys",
                  "Total number of containsKeys completed successfully", "containsKeys"),
              f.createIntCounter("containsKeyFailures",
                  "Total number of containsKey attempts that have failed", "containsKeys"),
              f.createIntCounter("containsKeyTimeouts",
                  "Total number of containsKey attempts that have timed out", "containsKeys"),
              f.createLongCounter("containsKeyTime",
                  "Total amount of time, in nanoseconds spent doing containsKeys", "nanoseconds"),
              f.createIntGauge("destroyRegionsInProgress",
                  "Current number of destroyRegions being executed", "destroyRegions"),
              f.createIntCounter("destroyRegions",
                  "Total number of destroyRegions completed successfully", "destroyRegions"),
              f.createIntCounter("destroyRegionFailures",
                  "Total number of destroyRegion attempts that have failed", "destroyRegions"),
              f.createIntCounter("destroyRegionTimeouts",
                  "Total number of destroyRegion attempts that have timed out", "destroyRegions"),
              f.createLongCounter("destroyRegionTime",
                  "Total amount of time, in nanoseconds spent doing destroyRegions", "nanoseconds"),
              f.createIntGauge("destroysInProgress", "Current number of destroys being executed",
                  "destroys"),
              f.createLongCounter("destroys", "Total number of destroys completed successfully",
                  "destroys"),
              f.createLongCounter("destroyFailures",
                  "Total number of destroy attempts that have failed", "destroys"),
              f.createLongCounter("destroyTimeouts",
                  "Total number of destroy attempts that have timed out", "destroys"),
              f.createLongCounter("destroyTime",
                  "Total amount of time, in nanoseconds spent doing destroys", "nanoseconds"),
              f.createIntGauge("executeFunctionsInProgress",
                  "Current number of Functions being executed", "executeFunctions"),
              f.createIntCounter("executeFunctions",
                  "Total number of Functions completed successfully", "executeFunctions"),
              f.createIntCounter("executeFunctionFailures",
                  "Total number of Function attempts that have failed", "executeFunctions"),
              f.createIntCounter("executeFunctionTimeouts",
                  "Total number of Function attempts that have timed out", "executeFunctions"),
              f.createLongCounter("executeFunctionTime",
                  "Total amount of time, in nanoseconds spent doing Functions", "nanoseconds"),
              f.createIntGauge("gatewayBatchsInProgress",
                  "Current number of gatewayBatchs being executed", "gatewayBatchs"),
              f.createIntCounter("gatewayBatchs",
                  "Total number of gatewayBatchs completed successfully", "gatewayBatchs"),
              f.createIntCounter("gatewayBatchFailures",
                  "Total number of gatewayBatch attempts that have failed", "gatewayBatchs"),
              f.createIntCounter("gatewayBatchTimeouts",
                  "Total number of gatewayBatch attempts that have timed out", "gatewayBatchs"),
              f.createLongCounter("gatewayBatchTime",
                  "Total amount of time, in nanoseconds spent doing gatewayBatchs", "nanoseconds"),
              f.createIntGauge("getAllsInProgress", "Current number of getAlls being executed",
                  "getAlls"),
              f.createIntCounter("getAlls", "Total number of getAlls completed successfully",
                  "getAlls"),
              f.createIntCounter("getAllFailures",
                  "Total number of getAll attempts that have failed", "getAlls"),
              f.createIntCounter("getAllTimeouts",
                  "Total number of getAll attempts that have timed out", "getAlls"),
              f.createLongCounter("getAllTime",
                  "Total amount of time, in nanoseconds spent doing getAlls", "nanoseconds"),
              f.createIntGauge("getClientPartitionAttributesInProgress",
                  "Current number of getClientPartitionAttributes operations being executed",
                  "getClientPartitionAttributes"),
              f.createIntCounter("getClientPartitionAttributesFailures",
                  "Total number of getClientPartitionAttributes operation attempts that have failed",
                  "getClientPartitionAttributes"),
              f.createIntCounter("getClientPartitionAttributesSuccessful",
                  "Total number of getClientPartitionAttributes operations completed successfully",
                  "getClientPartitionAttributes"),
              f.createIntCounter("getClientPartitionAttributesTimeouts",
                  "Total number of getClientPartitionAttributes operation attempts that have timed out",
                  "getClientPartitionAttributes"),
              f.createLongCounter("getClientPartitionAttributesTime",
                  "Total amount of time, in nanoseconds spent doing getClientPartitionAttributes successfully/unsuccessfully.",
                  "nanoseconds"),
              f.createIntGauge("getClientPRMetadataInProgress",
                  "Current number of getClientPRMetadata operations being executed",
                  "getClientPRMetadata"),
              f.createIntCounter("getClientPRMetadataFailures",
                  "Total number of getClientPRMetadata operation attempts that have failed",
                  "getClientPRMetadata"),
              f.createIntCounter("getClientPRMetadataSuccessful",
                  "Total number of getClientPRMetadata operations completed successfully",
                  "getClientPRMetadata"),
              f.createIntCounter("getClientPRMetadataTimeouts",
                  "Total number of getClientPRMetadata operation attempts that have timed out",
                  "getClientPRMetadata"),
              f.createLongCounter("getClientPRMetadataTime",
                  "Total amount of time, in nanoseconds spent doing getClientPRMetadata successfully/unsuccessfully",
                  "nanoseconds"),
              f.createIntGauge("getPDXIdForTypeInProgress",
                  "Current number of getPDXIdForType operations being executed", "getPDXIdForType"),
              f.createIntCounter("getPDXIdForTypeFailures",
                  "Total number of getPDXIdForType operation attempts that have failed",
                  "getPDXIdForType"),
              f.createIntCounter("getPDXIdForTypeSuccessful",
                  "Total number of getPDXIdForType operations completed successfully",
                  "getPDXIdForType"),
              f.createIntCounter("getPDXIdForTypeTimeouts",
                  "Total number of getPDXIdForType operation attempts that have timed out",
                  "getPDXIdForType"),
              f.createLongCounter("getPDXIdForTypeTime",
                  "Total amount of time, in nanoseconds spent doing getPDXIdForType successfully/unsuccessfully.",
                  "nanoseconds"),
              f.createIntGauge("getPDXTypeByIdInProgress",
                  "Current number of getPDXTypeById operations being executed", "getPDXTypeById"),
              f.createIntCounter("getPDXTypeByIdFailures",
                  "Total number of getPDXTypeById operation attempts that have failed",
                  "getPDXTypeById"),
              f.createIntCounter("getPDXTypeByIdSuccessful",
                  "Total number of getPDXTypeById operations completed successfully",
                  "getPDXTypeById"),
              f.createIntCounter("getPDXTypeByIdTimeouts",
                  "Total number of getPDXTypeById operation attempts that have timed out",
                  "getPDXTypeById"),
              f.createLongCounter("getPDXTypeByIdTime",
                  "Total amount of time, in nanoseconds spent doing getPDXTypeById successfully/unsuccessfully.",
                  "nanoseconds"),
              f.createIntGauge("getEntrysInProgress",
                  "Current number of getEntry messages being executed", "messages"),
              f.createIntCounter("getEntrys",
                  "Total number of getEntry messages completed successfully", "messages"),
              f.createIntCounter("getEntryFailures",
                  "Total number of getEntry attempts that have failed", "attempts"),
              f.createIntCounter("getEntryTimeouts",
                  "Total number of getEntry attempts that have timed out", "attempts"),
