All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.client.hotrod.impl.ServerStatisticsImpl Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.client.hotrod.impl;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.infinispan.client.hotrod.ServerStatistics;

/**
 * @author [email protected]
 * @since 4.1
 */
public class ServerStatisticsImpl implements ServerStatistics {

   private final Map stats = new HashMap<>();

   @Override
   public Map getStatsMap() {
      return Collections.unmodifiableMap(stats);
   }

   @Override
   public String getStatistic(String statsName) {
      return stats.get(statsName);
   }

   public void addStats(String name, String value) {
      stats.put(name, value);
   }

   public int size() {
      return stats.size();
   }

   @Override
   public Integer getIntStatistic(String statsName) {
      String value = stats.get(statsName);
      return value == null ? null : Integer.parseInt(value);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy