make info less chatty by pushing some things to debug

This commit is contained in:
Jonathan Shook 2021-01-13 14:15:14 -06:00
parent 837501f8b9
commit 1184fd77e9
7 changed files with 28 additions and 273 deletions

View File

@ -150,7 +150,7 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
// log tag filtering results
String tagfilter = activityDef.getParams().getOptionalString("tags").orElse("");
TagFilter tagFilter = new TagFilter(tagfilter);
unfiltered.getStmts().stream().map(tagFilter::matchesTaggedResult).forEach(r -> logger.info(r.getLog()));
unfiltered.getStmts().stream().map(tagFilter::matchesTaggedResult).forEach(r -> logger.debug(r.getLog()));
stmts = unfiltered.getStmts(tagfilter);

View File

@ -42,7 +42,7 @@ import java.util.stream.Collectors;
* generic type is parameterized for Bindings support.</p>
*/
public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bindings, ProxyObject {
private final static Logger logger = LogManager.getLogger(ParameterMap.class);
private final static Logger logger = LogManager.getLogger("PARAMS");
// private final ConcurrentHashMap<String, String> paramMap = new ConcurrentHashMap<>(10);
@ -162,7 +162,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
public void set(String paramName, Object newValue) {
super.put(paramName, String.valueOf(newValue));
logger.info("parameter " + paramName + " set to " + newValue);
logger.info("setting param " + paramName + "=" + newValue);
markMutation();
}
@ -173,7 +173,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
@Override
public Object put(String name, Object value) {
Object oldVal = super.put(name, String.valueOf(value));
logger.info("parameter " + name + " put to " + value);
logger.info("putting param " + name + "=" + value);
markMutation();
return oldVal;
@ -190,7 +190,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
@Override
public Object remove(Object key) {
Object removed = super.remove(key);
logger.info("parameter " + key + " removed");
logger.info("removing param: " + key);
markMutation();
return removed;
@ -198,7 +198,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
@Override
public void clear() {
logger.info("parameter map cleared:" + toString());
logger.debug("parameter map cleared:" + toString());
super.clear();
markMutation();
@ -206,7 +206,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
@Override
public Set<Entry<String, Object>> entrySet() {
logger.info("getting entry set for " + toString());
logger.debug("getting entry set for " + toString());
return super.entrySet()
.stream()
.map(e -> new AbstractMap.SimpleEntry<String,Object>(e.getKey(), e.getValue()) {})
@ -216,7 +216,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
private void markMutation() {
changeCounter.incrementAndGet();
logger.debug("calling " + listeners.size() + " listeners.");
logger.trace("calling " + listeners.size() + " listeners.");
callListeners();
}
@ -244,7 +244,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
private void callListeners() {
for (Listener listener : listeners) {
logger.info("calling listener:" + listener);
logger.trace("calling listener:" + listener);
listener.handleParameterMapUpdate(this);
}
}

View File

@ -358,7 +358,7 @@ public class SimpleActivity implements Activity, ProgressCapable {
logger.info("setting threads to " + threads + " (" + multiplier + "x)");
activityDef.setThreads(threads);
} else if (spec.toLowerCase().matches("\\d+")) {
logger.info("setting threads to " + spec + "(direct)");
logger.info("setting threads to " + spec + " (direct)");
activityDef.setThreads(Integer.parseInt(spec));
}

View File

@ -66,7 +66,7 @@ public class SimpleServiceLoader<T extends Named> {
throw new RuntimeException(t);
}
}
logger.info("Loaded Types:" + types.keySet());
logger.debug("Loaded Types:" + types.keySet());
return types;
}

View File

@ -115,6 +115,6 @@ public class ScenarioResult {
.outputTo(logger)
.build();
reporter.report();
logger.info("-- END METRICS DETAIL --");
logger.debug("-- END METRICS DETAIL --");
}
}

View File

@ -43,21 +43,21 @@ public class PolyglotMetricRegistryBindings implements ProxyObject, MetricRegist
@Override
public Object getMember(String key) {
logger.info("get member: " + key);
logger.trace("get member: " + key);
Object o = metrics.get(key);
return o;
}
@Override
public Object getMemberKeys() {
logger.info("get member keys");
logger.trace("get member keys");
ArrayList<String> keys = new ArrayList<>(metrics.getKeys());
return keys;
}
@Override
public boolean hasMember(String key) {
logger.info("has member? " + key);
logger.trace("has member? " + key);
boolean b = metrics.containsKey(key);
return b;
}
@ -77,62 +77,62 @@ public class PolyglotMetricRegistryBindings implements ProxyObject, MetricRegist
@Override
public void onGaugeAdded(String name, Gauge<?> gauge) {
metrics.add(name, gauge);
logger.info("gauge added: " + name);
logger.debug("gauge added: " + name);
}
@Override
public void onGaugeRemoved(String name) {
metrics.findOwner(name).remove(name);
logger.info("gauge removed: " + name);
logger.debug("gauge removed: " + name);
}
@Override
public void onCounterAdded(String name, Counter counter) {
metrics.add(name,counter);
logger.info("counter added: " + name + ", " + counter);
metrics.add(name, counter);
logger.debug("counter added: " + name + ", " + counter);
}
@Override
public void onCounterRemoved(String name) {
metrics.findOwner(name).remove(name);
logger.info("counter removed: " + name);
logger.debug("counter removed: " + name);
}
@Override
public void onHistogramAdded(String name, Histogram histogram) {
metrics.add(name, histogram);
logger.info("histogram added: " + name + ", " + histogram);
logger.debug("histogram added: " + name + ", " + histogram);
}
@Override
public void onHistogramRemoved(String name) {
metrics.findOwner(name).remove(name);
logger.info("histogram removed: " + name);
logger.debug("histogram removed: " + name);
}
@Override
public void onMeterAdded(String name, Meter meter) {
metrics.add(name,meter);
logger.info("meter added: " + name + ", " + meter);
metrics.add(name, meter);
logger.debug("meter added: " + name + ", " + meter);
}
@Override
public void onMeterRemoved(String name) {
metrics.findOwner(name).remove(name);
logger.info("meter removed: " + name);
logger.debug("meter removed: " + name);
}
@Override
public void onTimerAdded(String name, Timer timer) {
metrics.add(name, timer);
logger.info("timer added: " + name);
logger.debug("timer added: " + name);
}
@Override
public void onTimerRemoved(String name) {
metrics.findOwner(name).remove(name);
logger.info("timer removed: " + name);
logger.debug("timer removed: " + name);
}
public Map<String, Metric> getMetrics() {
@ -154,249 +154,4 @@ public class PolyglotMetricRegistryBindings implements ProxyObject, MetricRegist
return totalMap;
}
// @Override
// public int size() {
// return metricMap.map.size();
// }
//
// @Override
// public boolean isEmpty() {
// return metricMap.map.isEmpty();
// }
//
// @Override
// public boolean containsKey(Object key) {
// return metricMap.map.containsKey(key);
// }
//
// @Override
// public boolean containsValue(Object value) {
// return metricMap.map.containsValue(value);
// }
//
// @Override
// public Object get(Object key) {
// Object got = metricMap.map.get(key);
// if (got==null) {
// throw new RuntimeException("Attempted to get metrics node with name '" + key + "', but it was not found. Perhaps you were looking for one of its children: "
// + this.keySet().stream().collect(Collectors.joining(",","[","]")));
// }
// return got;
// }
//
// @Override
// public Set<String> keySet() {
// return metricMap.map.keySet();
// }
//
// @Override
// public Collection<Object> values() {
// return metricMap.map.values();
// }
//
// @Override
// public Set<Entry<String, Object>> entrySet() {
// return metricMap.map.entrySet();
// }
//
// @Override
// public void onGaugeAdded(String name, Gauge<?> metric) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.put(nodeNameOf(name), metric);
// }
//
// private String nodeNameOf(String name) {
// String[] split = name.split("\\.");
// return split[split.length - 1];
// }
//
// private synchronized void cleanEmptyMaps(MetricMap m) {
// while (m.isEmpty() && m.parent != null) {
// logger.debug("removing empty map:" + m.name);
// MetricMap parent = m.parent;
// m.parent = null;
// parent.map.remove(m.name);
// m = parent;
// }
// }
//
// private synchronized MetricMap findParentNodeOf(String fullName) {
// String[] names = fullName.split("\\.");
// MetricMap m = metricMap;
// for (int i = 0; i < names.length - 1; i++) {
// String edge = names[i];
// if (m.map.containsKey(edge)) {
// Object o = m.map.get(edge);
// if (o instanceof MetricMap) {
// m = (MetricMap) m.map.get(edge);
// logger.trace("traversing edge:" + edge + " while pathing to " + fullName);
//
// } else {
// String error = "edge exists at level:" + i + ", while pathing to " + fullName;
// logger.error(error);
// if (failfast) {
// throw new RuntimeException(error);
// }
// }
// } else {
// MetricMap newMap = new MetricMap(edge, m);
// m.map.put(edge, newMap);
// m = newMap;
// logger.debug("adding edge:" + edge + " while pathing to " + fullName);
// }
// }
// return m;
// }
//
// @Override
// public void onGaugeRemoved(String name) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.remove(nodeNameOf(name));
// cleanEmptyMaps(parent);
// }
//
// @Override
// public void onCounterAdded(String name, Counter metric) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.put(nodeNameOf(name), metric);
//
// }
//
// @Override
// public void onCounterRemoved(String name) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.remove(nodeNameOf(name));
// cleanEmptyMaps(parent);
// }
//
// @Override
// public void onHistogramAdded(String name, Histogram metric) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.put(nodeNameOf(name), metric);
//
// }
//
// @Override
// public void onHistogramRemoved(String name) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.remove(nodeNameOf(name));
// cleanEmptyMaps(parent);
//
// }
//
// @Override
// public void onMeterAdded(String name, Meter metric) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.put(nodeNameOf(name), metric);
//
// }
//
// @Override
// public void onMeterRemoved(String name) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.remove(nodeNameOf(name));
// cleanEmptyMaps(parent);
//
// }
//
// @Override
// public void onTimerAdded(String name, Timer metric) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.put(nodeNameOf(name), metric);
//
// }
//
// @Override
// public void onTimerRemoved(String name) {
// MetricMap parent = findParentNodeOf(name);
// parent.map.remove(nodeNameOf(name));
// cleanEmptyMaps(parent);
//
// }
//
// public Map<String, Metric> getMetrics() {
// return getMetrics(new LinkedHashMap<String, Metric>(), "metrics", metricMap);
// }
//
// private Map<String, Metric> getMetrics(Map<String, Metric> totalMap, String prefix, MetricMap map) {
// for (Entry<String, Object> mEntry : map.entrySet()) {
// Object o = mEntry.getValue();
// String name = prefix + "." + mEntry.getKey();
// if (o instanceof Metric) {
// totalMap.put(name, (Metric) o);
// } else if (o instanceof MetricMap) {
// getMetrics(totalMap, name, (MetricMap) o);
// } else {
// throw new RuntimeException("entry value must be either a Metric or a MetricMap");
// }
// }
// return totalMap;
// }
//
// private class MetricMap extends ReadOnlyBindings {
// Map<String, Object> map = new HashMap<String, Object>();
// MetricMap parent = null;
// public String name;
//
// MetricMap(String name) {
// this.name = name;
// }
//
// public MetricMap(String name, MetricMap parent) {
// this.parent = parent;
// this.name = name;
// }
//
// public int size() {
// return map.size();
// }
//
// @Override
// public boolean isEmpty() {
// return map.isEmpty();
// }
//
// @Override
// public boolean containsKey(Object key) {
// boolean containsKey=map.containsKey(key);
// if (containsKey==false) {
// throw new RuntimeException("Attempted to get metrics node with name '" + key + "', but it was not found. Perhaps you " +
// "were looking for one of " + this.map.keySet().stream().collect(Collectors.joining(",","[","]")));
// }
// return true;
// }
//
// @Override
// public boolean containsValue(Object value) {
// return map.containsValue(value);
// }
//
// @Override
// public Object get(Object key) {
// Object got=map.get(key);
// if (got==null) {
// throw new RuntimeException("Attempted to get metrics node with name '" + key + "', but it was not found. Perhaps you " +
// "were looking for one of " + this.map.keySet().stream().collect(Collectors.joining(",","[","]")));
// }
// return got;
// }
//
// @Override
// public Set<String> keySet() {
// return map.keySet();
// }
//
// @Override
// public Collection<Object> values() {
// return map.values();
// }
//
// @Override
// public Set<Entry<String, Object>> entrySet() {
// return map.entrySet();
// }
//
// }
}

View File

@ -104,7 +104,7 @@ public class ScenariosExecutor {
updateAt = Math.min(timeoutAt, System.currentTimeMillis() + updateInterval);
}
logger.info("scenarios executor shutdownActivity after " + (System.currentTimeMillis() - waitedAt) + "ms.");
logger.debug("scenarios executor shutdown after " + (System.currentTimeMillis() - waitedAt) + "ms.");
}
if (!isShutdown) {