private int getWeight(String value) {

    if (StringUtils.isEmpty(value) || value.equals("NONE")) {
      return SessionProfiler.NONE;
    }

    if (value.equals("ALL")) {
      return SessionProfiler.ALL;
    }

    if (value.equals("NORMAL")) {
      return SessionProfiler.NORMAL;
    }

    return SessionProfiler.HEAVY;
  }
Utlity method to get Profiling weight in Integer from String.
@param value NONE/HEAVY/ALL/NORMAL
@return SessionProfiler.HEAVY/NONE/ALL/NORMAL
ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java