com.nitorcreations.willow.metrics.RequestCountMetric Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of willow-servers Show documentation
Show all versions of willow-servers Show documentation
Willow operational servlets and servers
The newest version!
package com.nitorcreations.willow.metrics;
import java.util.List;
import javax.inject.Named;
import com.nitorcreations.willow.messages.metrics.MetricConfig;
@Named("/requests")
public class RequestCountMetric extends SimpleMetric {
@Override
public String getType() {
return "access";
}
@Override
public String[] requiresFields() {
return new String[] { "duration" };
}
@Override
protected Integer estimateValue(List preceeding, long stepTime, long stepLen, MetricConfig conf) {
return preceeding.size();
}
@Override
protected Integer fillMissingValue() {
return 0;
}
}