repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/RequestOrientedStats.java | RequestOrientedStats.addExecutionTime | public void addExecutionTime(long time) {
totalTime.increaseByLong(time);
lastRequest.setValueAsLong(time);
minTime.setValueIfLesserThanCurrentAsLong(time);
maxTime.setValueIfGreaterThanCurrentAsLong(time);
} | java | public void addExecutionTime(long time) {
totalTime.increaseByLong(time);
lastRequest.setValueAsLong(time);
minTime.setValueIfLesserThanCurrentAsLong(time);
maxTime.setValueIfGreaterThanCurrentAsLong(time);
} | [
"public",
"void",
"addExecutionTime",
"(",
"long",
"time",
")",
"{",
"totalTime",
".",
"increaseByLong",
"(",
"time",
")",
";",
"lastRequest",
".",
"setValueAsLong",
"(",
"time",
")",
";",
"minTime",
".",
"setValueIfLesserThanCurrentAsLong",
"(",
"time",
")",
... | Adds messed execution time to the total execution time.
@param time | [
"Adds",
"messed",
"execution",
"time",
"to",
"the",
"total",
"execution",
"time",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/RequestOrientedStats.java#L209-L215 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/RequestOrientedStats.java | RequestOrientedStats.getAverageRequestDuration | public double getAverageRequestDuration(String intervalName, TimeUnit unit) {
return unit.transformNanos(totalTime.getValueAsLong(intervalName)) / totalRequests.getValueAsDouble(intervalName);
} | java | public double getAverageRequestDuration(String intervalName, TimeUnit unit) {
return unit.transformNanos(totalTime.getValueAsLong(intervalName)) / totalRequests.getValueAsDouble(intervalName);
} | [
"public",
"double",
"getAverageRequestDuration",
"(",
"String",
"intervalName",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"unit",
".",
"transformNanos",
"(",
"totalTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
")",
"/",
"totalRequests",
".",
"getValue... | Returns the average request duration for the given interval and converted to the given timeunit.
@param intervalName name of the interval.
@param unit timeunit.
@return | [
"Returns",
"the",
"average",
"request",
"duration",
"for",
"the",
"given",
"interval",
"and",
"converted",
"to",
"the",
"given",
"timeunit",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/RequestOrientedStats.java#L240-L242 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/RequestOrientedStats.java | RequestOrientedStats.getErrorRate | public double getErrorRate(String intervalName){
long tr = getTotalRequests(intervalName);
double errorRate = tr == 0? 0:((double)getErrors(intervalName))/tr;
return (double)((int)(errorRate * 10000))/100;
} | java | public double getErrorRate(String intervalName){
long tr = getTotalRequests(intervalName);
double errorRate = tr == 0? 0:((double)getErrors(intervalName))/tr;
return (double)((int)(errorRate * 10000))/100;
} | [
"public",
"double",
"getErrorRate",
"(",
"String",
"intervalName",
")",
"{",
"long",
"tr",
"=",
"getTotalRequests",
"(",
"intervalName",
")",
";",
"double",
"errorRate",
"=",
"tr",
"==",
"0",
"?",
"0",
":",
"(",
"(",
"double",
")",
"getErrors",
"(",
"int... | Returns the error rate. This value was previously calculated in decorator, but we moved it into the stats object to be able to define threshold on top of it.
@param intervalName name of the interval.
@return the error rate in percent. | [
"Returns",
"the",
"error",
"rate",
".",
"This",
"value",
"was",
"previously",
"calculated",
"in",
"decorator",
"but",
"we",
"moved",
"it",
"into",
"the",
"stats",
"object",
"to",
"be",
"able",
"to",
"define",
"threshold",
"on",
"top",
"of",
"it",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/RequestOrientedStats.java#L249-L253 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/ApacheStats.java | ApacheStats.handleStatsResetIfNeeded | protected void handleStatsResetIfNeeded(StatusData<ApacheMetrics> status) {
StatValue uptime = getStatValue(ApacheMetrics.SERVER_UPTIME);
Long currUptime = Long.class.cast(status.get(ApacheMetrics.SERVER_UPTIME));
if (uptime != null && currUptime != null && uptime.getValueAsLong() > currUptime) ... | java | protected void handleStatsResetIfNeeded(StatusData<ApacheMetrics> status) {
StatValue uptime = getStatValue(ApacheMetrics.SERVER_UPTIME);
Long currUptime = Long.class.cast(status.get(ApacheMetrics.SERVER_UPTIME));
if (uptime != null && currUptime != null && uptime.getValueAsLong() > currUptime) ... | [
"protected",
"void",
"handleStatsResetIfNeeded",
"(",
"StatusData",
"<",
"ApacheMetrics",
">",
"status",
")",
"{",
"StatValue",
"uptime",
"=",
"getStatValue",
"(",
"ApacheMetrics",
".",
"SERVER_UPTIME",
")",
";",
"Long",
"currUptime",
"=",
"Long",
".",
"class",
... | Check SERVER_UPTIME metric and if its value is lower than the stored one -
monitored apache server was restarted. In this case all DIFFLONG statValues
need resetting.
@param status latest status data. | [
"Check",
"SERVER_UPTIME",
"metric",
"and",
"if",
"its",
"value",
"is",
"lower",
"than",
"the",
"stored",
"one",
"-",
"monitored",
"apache",
"server",
"was",
"restarted",
".",
"In",
"this",
"case",
"all",
"DIFFLONG",
"statValues",
"need",
"resetting",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/ApacheStats.java#L39-L51 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/accumulation/AutoAccumulatorDefinition.java | AutoAccumulatorDefinition.toAccumulatorDefinition | public AccumulatorDefinition toAccumulatorDefinition(String producerId){
AccumulatorDefinition ret = new AccumulatorDefinition();
ret.setProducerName(producerId);
ret.setName(replaceName(producerId));
ret.setStatName(getStatName());
ret.setValueName(getValueName());
ret.setIntervalName(getIntervalName());
... | java | public AccumulatorDefinition toAccumulatorDefinition(String producerId){
AccumulatorDefinition ret = new AccumulatorDefinition();
ret.setProducerName(producerId);
ret.setName(replaceName(producerId));
ret.setStatName(getStatName());
ret.setValueName(getValueName());
ret.setIntervalName(getIntervalName());
... | [
"public",
"AccumulatorDefinition",
"toAccumulatorDefinition",
"(",
"String",
"producerId",
")",
"{",
"AccumulatorDefinition",
"ret",
"=",
"new",
"AccumulatorDefinition",
"(",
")",
";",
"ret",
".",
"setProducerName",
"(",
"producerId",
")",
";",
"ret",
".",
"setName"... | Creates a new AccumulatorDefinition object for matched producer.
@param producerId
@return | [
"Creates",
"a",
"new",
"AccumulatorDefinition",
"object",
"for",
"matched",
"producer",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/accumulation/AutoAccumulatorDefinition.java#L54-L64 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/config/tagging/CustomTag.java | CustomTag.getAttributeName | public String getAttributeName() {
return !StringUtils.isEmpty(attribute) && attribute.contains(".") ?
attribute.substring(attribute.indexOf(".") + 1, attribute.length()) : "";
} | java | public String getAttributeName() {
return !StringUtils.isEmpty(attribute) && attribute.contains(".") ?
attribute.substring(attribute.indexOf(".") + 1, attribute.length()) : "";
} | [
"public",
"String",
"getAttributeName",
"(",
")",
"{",
"return",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"attribute",
")",
"&&",
"attribute",
".",
"contains",
"(",
"\".\"",
")",
"?",
"attribute",
".",
"substring",
"(",
"attribute",
".",
"indexOf",
"(",
"\... | Retrieves attribute name. | [
"Retrieves",
"attribute",
"name",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/config/tagging/CustomTag.java#L66-L69 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/decorator/GenericStatsDecorator.java | GenericStatsDecorator.extract | private static String[] extract(List<? extends IGenericMetrics> metrics, Extractor e) {
List<String> strings = new ArrayList<>(metrics.size());
for (IGenericMetrics metric : metrics) {
strings.add(e.extract(metric));
}
return strings.toArray(new String[strings.size()]);
} | java | private static String[] extract(List<? extends IGenericMetrics> metrics, Extractor e) {
List<String> strings = new ArrayList<>(metrics.size());
for (IGenericMetrics metric : metrics) {
strings.add(e.extract(metric));
}
return strings.toArray(new String[strings.size()]);
} | [
"private",
"static",
"String",
"[",
"]",
"extract",
"(",
"List",
"<",
"?",
"extends",
"IGenericMetrics",
">",
"metrics",
",",
"Extractor",
"e",
")",
"{",
"List",
"<",
"String",
">",
"strings",
"=",
"new",
"ArrayList",
"<>",
"(",
"metrics",
".",
"size",
... | Get array of Strings from metrics - one from each with given Extractor.
@param metrics metrics to extract values from.
@param e extractor that extracts values
@return array of corresponding strings. | [
"Get",
"array",
"of",
"Strings",
"from",
"metrics",
"-",
"one",
"from",
"each",
"with",
"given",
"Extractor",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/decorator/GenericStatsDecorator.java#L102-L108 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/MemoryPoolStats.java | MemoryPoolStats.setUsed | public void setUsed(long value){
used.setValueAsLong(value);
minUsed.setValueIfLesserThanCurrentAsLong(value);
maxUsed.setValueIfGreaterThanCurrentAsLong(value);
} | java | public void setUsed(long value){
used.setValueAsLong(value);
minUsed.setValueIfLesserThanCurrentAsLong(value);
maxUsed.setValueIfGreaterThanCurrentAsLong(value);
} | [
"public",
"void",
"setUsed",
"(",
"long",
"value",
")",
"{",
"used",
".",
"setValueAsLong",
"(",
"value",
")",
";",
"minUsed",
".",
"setValueIfLesserThanCurrentAsLong",
"(",
"value",
")",
";",
"maxUsed",
".",
"setValueIfGreaterThanCurrentAsLong",
"(",
"value",
"... | Sets new used memory amount.
@param value the memory amount. | [
"Sets",
"new",
"used",
"memory",
"amount",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/MemoryPoolStats.java#L203-L207 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/MemoryPoolStats.java | MemoryPoolStats.setCommited | public void setCommited(long value){
commited.setValueAsLong(value);
minCommited.setValueIfLesserThanCurrentAsLong(value);
maxCommited.setValueIfGreaterThanCurrentAsLong(value);
} | java | public void setCommited(long value){
commited.setValueAsLong(value);
minCommited.setValueIfLesserThanCurrentAsLong(value);
maxCommited.setValueIfGreaterThanCurrentAsLong(value);
} | [
"public",
"void",
"setCommited",
"(",
"long",
"value",
")",
"{",
"commited",
".",
"setValueAsLong",
"(",
"value",
")",
";",
"minCommited",
".",
"setValueIfLesserThanCurrentAsLong",
"(",
"value",
")",
";",
"maxCommited",
".",
"setValueIfGreaterThanCurrentAsLong",
"("... | Sets new commited memory amount.
@param value the memory amount. | [
"Sets",
"new",
"commited",
"memory",
"amount",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/MemoryPoolStats.java#L213-L217 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.addLoadTime | public void addLoadTime(final long domLoadTime, final long windowLoadTime) {
totalDomLoadTime.increaseByLong(domLoadTime);
domMinLoadTime.setValueIfLesserThanCurrentAsLong(domLoadTime);
domMaxLoadTime.setValueIfGreaterThanCurrentAsLong(domLoadTime);
domLastLoadTime.setValueAsLong(domLoadTime);
totalWindowLoad... | java | public void addLoadTime(final long domLoadTime, final long windowLoadTime) {
totalDomLoadTime.increaseByLong(domLoadTime);
domMinLoadTime.setValueIfLesserThanCurrentAsLong(domLoadTime);
domMaxLoadTime.setValueIfGreaterThanCurrentAsLong(domLoadTime);
domLastLoadTime.setValueAsLong(domLoadTime);
totalWindowLoad... | [
"public",
"void",
"addLoadTime",
"(",
"final",
"long",
"domLoadTime",
",",
"final",
"long",
"windowLoadTime",
")",
"{",
"totalDomLoadTime",
".",
"increaseByLong",
"(",
"domLoadTime",
")",
";",
"domMinLoadTime",
".",
"setValueIfLesserThanCurrentAsLong",
"(",
"domLoadTi... | Adds DOM load time and page load time to the stats.
@param domLoadTime DOM load time
@param windowLoadTime web page load time | [
"Adds",
"DOM",
"load",
"time",
"and",
"page",
"load",
"time",
"to",
"the",
"stats",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L105-L115 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getDomMinLoadTime | public long getDomMinLoadTime(final String intervalName, final TimeUnit unit) {
final long min = domMinLoadTime.getValueAsLong(intervalName);
return min == Constants.MIN_TIME_DEFAULT ? min : unit.transformMillis(min);
} | java | public long getDomMinLoadTime(final String intervalName, final TimeUnit unit) {
final long min = domMinLoadTime.getValueAsLong(intervalName);
return min == Constants.MIN_TIME_DEFAULT ? min : unit.transformMillis(min);
} | [
"public",
"long",
"getDomMinLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"final",
"long",
"min",
"=",
"domMinLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
";",
"return",
"min",
"==",
"Constants",
... | Returns DOM minimum load time for given interval and time unit.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return DOM minimum load time | [
"Returns",
"DOM",
"minimum",
"load",
"time",
"for",
"given",
"interval",
"and",
"time",
"unit",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L129-L132 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getDomMaxLoadTime | public long getDomMaxLoadTime(final String intervalName, final TimeUnit unit) {
final long max = domMaxLoadTime.getValueAsLong(intervalName);
return max == Constants.MAX_TIME_DEFAULT ? max : unit.transformMillis(max);
} | java | public long getDomMaxLoadTime(final String intervalName, final TimeUnit unit) {
final long max = domMaxLoadTime.getValueAsLong(intervalName);
return max == Constants.MAX_TIME_DEFAULT ? max : unit.transformMillis(max);
} | [
"public",
"long",
"getDomMaxLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"final",
"long",
"max",
"=",
"domMaxLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
";",
"return",
"max",
"==",
"Constants",
... | Returns DOM maximum load time for given interval and time unit.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return DOM maximum load time | [
"Returns",
"DOM",
"maximum",
"load",
"time",
"for",
"given",
"interval",
"and",
"time",
"unit",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L141-L144 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/util/ProducerUtility.java | ProducerUtility.getDecoratedProducers | public static List<ProducerDecoratorBean> getDecoratedProducers(HttpServletRequest req, List<ProducerAO> producers, Map<String, GraphDataBean> graphData){
Map<IDecorator, List<ProducerAO>> decoratorMap = new HashMap<>(producers.size());
for (ProducerAO producer : producers){
try{
... | java | public static List<ProducerDecoratorBean> getDecoratedProducers(HttpServletRequest req, List<ProducerAO> producers, Map<String, GraphDataBean> graphData){
Map<IDecorator, List<ProducerAO>> decoratorMap = new HashMap<>(producers.size());
for (ProducerAO producer : producers){
try{
... | [
"public",
"static",
"List",
"<",
"ProducerDecoratorBean",
">",
"getDecoratedProducers",
"(",
"HttpServletRequest",
"req",
",",
"List",
"<",
"ProducerAO",
">",
"producers",
",",
"Map",
"<",
"String",
",",
"GraphDataBean",
">",
"graphData",
")",
"{",
"Map",
"<",
... | todo make separate method for graphData in future | [
"todo",
"make",
"separate",
"method",
"for",
"graphData",
"in",
"future"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/util/ProducerUtility.java#L38-L91 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/util/ProducerUtility.java | ProducerUtility.filterProducersByDecoratorName | public static ProducerDecoratorBean filterProducersByDecoratorName(String decoratorName, List<ProducerAO> producers, Map<String, GraphDataBean> graphData) {
ProducerDecoratorBean result = new ProducerDecoratorBean();
result.setName(decoratorName);
List<ProducerAO> decoratedProducers = new Array... | java | public static ProducerDecoratorBean filterProducersByDecoratorName(String decoratorName, List<ProducerAO> producers, Map<String, GraphDataBean> graphData) {
ProducerDecoratorBean result = new ProducerDecoratorBean();
result.setName(decoratorName);
List<ProducerAO> decoratedProducers = new Array... | [
"public",
"static",
"ProducerDecoratorBean",
"filterProducersByDecoratorName",
"(",
"String",
"decoratorName",
",",
"List",
"<",
"ProducerAO",
">",
"producers",
",",
"Map",
"<",
"String",
",",
"GraphDataBean",
">",
"graphData",
")",
"{",
"ProducerDecoratorBean",
"resu... | Filters producers by decorator and returns it.
@param decoratorName Decorator name
@param producers {@link List} of {@link ProducerAO} to filter
@param graphData Graph data | [
"Filters",
"producers",
"by",
"decorator",
"and",
"returns",
"it",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/util/ProducerUtility.java#L99-L133 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/NginxStubStatusParser.java | NginxStubStatusParser.parse | public StatusData<NginxMetrics> parse(String nginxStatus) {
StatusData<NginxMetrics> status = new StatusData<>();
if (StringUtils.isEmpty(nginxStatus)) {
throw new IllegalArgumentException("nginx status is empty!");
} else {
Matcher matcher = pattern.matcher(nginxStatus);... | java | public StatusData<NginxMetrics> parse(String nginxStatus) {
StatusData<NginxMetrics> status = new StatusData<>();
if (StringUtils.isEmpty(nginxStatus)) {
throw new IllegalArgumentException("nginx status is empty!");
} else {
Matcher matcher = pattern.matcher(nginxStatus);... | [
"public",
"StatusData",
"<",
"NginxMetrics",
">",
"parse",
"(",
"String",
"nginxStatus",
")",
"{",
"StatusData",
"<",
"NginxMetrics",
">",
"status",
"=",
"new",
"StatusData",
"<>",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"nginxStatus",
... | Parse NGINX stub status into StatusData<NginxMetrics>.
@param nginxStatus retrieved stub status.
@return parsed metrics, put into StatusData. | [
"Parse",
"NGINX",
"stub",
"status",
"into",
"StatusData<",
";",
"NginxMetrics>",
";",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/NginxStubStatusParser.java#L36-L65 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/blueprint/BlueprintProducer.java | BlueprintProducer.execute | public Object execute(BlueprintCallExecutor executor, Object... parameters) throws Exception{
stats.addRequest();
long startTime = System.nanoTime();
TracedCall aTracedCall = RunningTraceContainer.getCurrentlyTracedCall();
TraceStep currentElement = null;
CurrentlyTracedCall currentlyTracedCall = aTracedCall.... | java | public Object execute(BlueprintCallExecutor executor, Object... parameters) throws Exception{
stats.addRequest();
long startTime = System.nanoTime();
TracedCall aTracedCall = RunningTraceContainer.getCurrentlyTracedCall();
TraceStep currentElement = null;
CurrentlyTracedCall currentlyTracedCall = aTracedCall.... | [
"public",
"Object",
"execute",
"(",
"BlueprintCallExecutor",
"executor",
",",
"Object",
"...",
"parameters",
")",
"throws",
"Exception",
"{",
"stats",
".",
"addRequest",
"(",
")",
";",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"Trac... | Called by the surrounding code whenever the action which we are measuring is actually executed.
@param executor the object the action is executed on
@param parameters parameters for the action
@return
@throws Exception | [
"Called",
"by",
"the",
"surrounding",
"code",
"whenever",
"the",
"action",
"which",
"we",
"are",
"measuring",
"is",
"actually",
"executed",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/blueprint/BlueprintProducer.java#L74-L98 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java | ConnectorsRegistry.addConnector | public void addConnector(Connector connector) {
connectors.put(connector.getClass().getCanonicalName(), new ConnectorEntry(connector));
} | java | public void addConnector(Connector connector) {
connectors.put(connector.getClass().getCanonicalName(), new ConnectorEntry(connector));
} | [
"public",
"void",
"addConnector",
"(",
"Connector",
"connector",
")",
"{",
"connectors",
".",
"put",
"(",
"connector",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
",",
"new",
"ConnectorEntry",
"(",
"connector",
")",
")",
";",
"}"
] | Registers new connector
@param connector connector to register | [
"Registers",
"new",
"connector"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java#L26-L28 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java | ConnectorsRegistry.enableConnector | public void enableConnector(String connectorClass, Properties connectorInitProperties) throws ConnectorInitException {
ConnectorEntry connector = connectors.get(connectorClass);
if(connector != null)
connectors.get(connectorClass).enableConnector(connectorInitProperties);
} | java | public void enableConnector(String connectorClass, Properties connectorInitProperties) throws ConnectorInitException {
ConnectorEntry connector = connectors.get(connectorClass);
if(connector != null)
connectors.get(connectorClass).enableConnector(connectorInitProperties);
} | [
"public",
"void",
"enableConnector",
"(",
"String",
"connectorClass",
",",
"Properties",
"connectorInitProperties",
")",
"throws",
"ConnectorInitException",
"{",
"ConnectorEntry",
"connector",
"=",
"connectors",
".",
"get",
"(",
"connectorClass",
")",
";",
"if",
"(",
... | Makes enable connector with given class name if
it registered and not already enabled.
Non-existing or already enabled connectors be ignored
@param connectorClass connector class canonical name
@param connectorInitProperties initialization properties of connector
@throws ConnectorInitException | [
"Makes",
"enable",
"connector",
"with",
"given",
"class",
"name",
"if",
"it",
"registered",
"and",
"not",
"already",
"enabled",
".",
"Non",
"-",
"existing",
"or",
"already",
"enabled",
"connectors",
"be",
"ignored"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java#L50-L57 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java | ConnectorsRegistry.disableConnector | public void disableConnector(String connectorClass) {
ConnectorEntry connector = connectors.get(connectorClass);
if(connector != null)
connectors.get(connectorClass).disableConnector();
} | java | public void disableConnector(String connectorClass) {
ConnectorEntry connector = connectors.get(connectorClass);
if(connector != null)
connectors.get(connectorClass).disableConnector();
} | [
"public",
"void",
"disableConnector",
"(",
"String",
"connectorClass",
")",
"{",
"ConnectorEntry",
"connector",
"=",
"connectors",
".",
"get",
"(",
"connectorClass",
")",
";",
"if",
"(",
"connector",
"!=",
"null",
")",
"connectors",
".",
"get",
"(",
"connector... | Denitializes connector with given class name.
Non-existing or not enabled connectors be ignored
@param connectorClass connector class canonical name | [
"Denitializes",
"connector",
"with",
"given",
"class",
"name",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConnectorsRegistry.java#L66-L73 | train |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.getProducer | protected OnDemandStatsProducer<S> getProducer(final ProceedingJoinPoint pjp, final String aProducerId, final String aCategory, final String aSubsystem, final boolean withMethod,
final IOnDemandStatsFactory<S> factory, final boolean tracingSupported, final boolean attachDefaultStatsLoggers) {
final Str... | java | protected OnDemandStatsProducer<S> getProducer(final ProceedingJoinPoint pjp, final String aProducerId, final String aCategory, final String aSubsystem, final boolean withMethod,
final IOnDemandStatsFactory<S> factory, final boolean tracingSupported, final boolean attachDefaultStatsLoggers) {
final Str... | [
"protected",
"OnDemandStatsProducer",
"<",
"S",
">",
"getProducer",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
",",
"final",
"String",
"aProducerId",
",",
"final",
"String",
"aCategory",
",",
"final",
"String",
"aSubsystem",
",",
"final",
"boolean",
"withMethod",
... | Returns the producer for the given pjp and producerId. Registers the producer in the registry if it's not already registered.
@param pjp
the pjp is used to obtain the producer id automatically if it's not submitted.
@param aProducerId
submitted producer id, used if configured in aop.
@param aCategory
submitted categor... | [
"Returns",
"the",
"producer",
"for",
"the",
"given",
"pjp",
"and",
"producerId",
".",
"Registers",
"the",
"producer",
"in",
"the",
"registry",
"if",
"it",
"s",
"not",
"already",
"registered",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L103-L174 | train |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.getProducerId | private String getProducerId(final ProceedingJoinPoint pjp, final String aPId, final boolean withMethod) {
if (!StringUtils.isEmpty(aPId))
return aPId;
String res = pjp.getSignature().getDeclaringTypeName();
try {
res = MoskitoUtils.producerName(res);
} catch (final RuntimeException e) {
if (logger.is... | java | private String getProducerId(final ProceedingJoinPoint pjp, final String aPId, final boolean withMethod) {
if (!StringUtils.isEmpty(aPId))
return aPId;
String res = pjp.getSignature().getDeclaringTypeName();
try {
res = MoskitoUtils.producerName(res);
} catch (final RuntimeException e) {
if (logger.is... | [
"private",
"String",
"getProducerId",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
",",
"final",
"String",
"aPId",
",",
"final",
"boolean",
"withMethod",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"aPId",
")",
")",
"return",
"aPId",
";",
... | Fetch producer id - for further usage.
@param pjp
{@link ProceedingJoinPoint}
@param aPId
provided producer id
@param withMethod
{@code true} in case if methodName should be used in produce id, {@code false} otheriwse
@return producer identifier | [
"Fetch",
"producer",
"id",
"-",
"for",
"further",
"usage",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L188-L203 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/monitor/MonitorInterceptor.java | MonitorInterceptor.getMethodName | private String getMethodName(Method method) {
StatName statName = method.getAnnotation(StatName.class);
return statName == null ? method.getName() : statName.value();
} | java | private String getMethodName(Method method) {
StatName statName = method.getAnnotation(StatName.class);
return statName == null ? method.getName() : statName.value();
} | [
"private",
"String",
"getMethodName",
"(",
"Method",
"method",
")",
"{",
"StatName",
"statName",
"=",
"method",
".",
"getAnnotation",
"(",
"StatName",
".",
"class",
")",
";",
"return",
"statName",
"==",
"null",
"?",
"method",
".",
"getName",
"(",
")",
":",... | Returns name for monitored method.
@param method the monitored {@link Method}
@return the method name or custom name provided via {@link StatName} annotation | [
"Returns",
"name",
"for",
"monitored",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/monitor/MonitorInterceptor.java#L206-L209 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/JMXBridgeListener.java | JMXBridgeListener.createName | private String createName(String producerId, String statName) {
String appName = encodeAppName(MoskitoConfigurationHolder.getConfiguration().getApplicationName());
return "MoSKito."+(appName.length()>0 ? appName+ '.' :"")+"producers:type="+producerId+ '.' +statName;
} | java | private String createName(String producerId, String statName) {
String appName = encodeAppName(MoskitoConfigurationHolder.getConfiguration().getApplicationName());
return "MoSKito."+(appName.length()>0 ? appName+ '.' :"")+"producers:type="+producerId+ '.' +statName;
} | [
"private",
"String",
"createName",
"(",
"String",
"producerId",
",",
"String",
"statName",
")",
"{",
"String",
"appName",
"=",
"encodeAppName",
"(",
"MoskitoConfigurationHolder",
".",
"getConfiguration",
"(",
")",
".",
"getApplicationName",
"(",
")",
")",
";",
"... | Creates JMX name for a producer.
@param producerId target producerId.
@param statName target statName.
@return the name for JMXBean. | [
"Creates",
"JMX",
"name",
"for",
"a",
"producer",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/JMXBridgeListener.java#L65-L68 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/ThreadCountStats.java | ThreadCountStats.update | public void update(long aStarted, long aDaemon, long aCurrent){
current.setValueAsLong(aCurrent);
started.setValueAsLong(aStarted);
daemon.setValueAsLong(aDaemon);
minCurrent.setValueIfLesserThanCurrentAsLong(aCurrent);
maxCurrent.setValueIfGreaterThanCurrentAsLong(aCurrent);
} | java | public void update(long aStarted, long aDaemon, long aCurrent){
current.setValueAsLong(aCurrent);
started.setValueAsLong(aStarted);
daemon.setValueAsLong(aDaemon);
minCurrent.setValueIfLesserThanCurrentAsLong(aCurrent);
maxCurrent.setValueIfGreaterThanCurrentAsLong(aCurrent);
} | [
"public",
"void",
"update",
"(",
"long",
"aStarted",
",",
"long",
"aDaemon",
",",
"long",
"aCurrent",
")",
"{",
"current",
".",
"setValueAsLong",
"(",
"aCurrent",
")",
";",
"started",
".",
"setValueAsLong",
"(",
"aStarted",
")",
";",
"daemon",
".",
"setVal... | Called regularly by a timer, updates the internal stats.
@param aStarted
@param aDaemon
@param aCurrent | [
"Called",
"regularly",
"by",
"a",
"timer",
"updates",
"the",
"internal",
"stats",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/ThreadCountStats.java#L85-L92 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java | JSTalkBackFilter.getValueOrDefault | private String getValueOrDefault(HttpServletRequest req, String paramName, String defaultValue) {
final String value = req.getParameter(paramName);
return StringUtils.isEmpty(value) ? defaultValue : value;
} | java | private String getValueOrDefault(HttpServletRequest req, String paramName, String defaultValue) {
final String value = req.getParameter(paramName);
return StringUtils.isEmpty(value) ? defaultValue : value;
} | [
"private",
"String",
"getValueOrDefault",
"(",
"HttpServletRequest",
"req",
",",
"String",
"paramName",
",",
"String",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"req",
".",
"getParameter",
"(",
"paramName",
")",
";",
"return",
"StringUtils",
"."... | Returns parameter value from request if exists, otherwise - default value.
@param req {@link HttpServletRequest}
@param paramName name of the parameter
@param defaultValue parameter default value
@return request parameter value | [
"Returns",
"parameter",
"value",
"from",
"request",
"if",
"exists",
"otherwise",
"-",
"default",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java#L139-L142 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java | JSTalkBackFilter.isLoadTimeValid | private boolean isLoadTimeValid(final String loadTimeParam) {
return !StringUtils.isEmpty(loadTimeParam) && isLong(loadTimeParam) && Long.valueOf(loadTimeParam) > 0;
} | java | private boolean isLoadTimeValid(final String loadTimeParam) {
return !StringUtils.isEmpty(loadTimeParam) && isLong(loadTimeParam) && Long.valueOf(loadTimeParam) > 0;
} | [
"private",
"boolean",
"isLoadTimeValid",
"(",
"final",
"String",
"loadTimeParam",
")",
"{",
"return",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"loadTimeParam",
")",
"&&",
"isLong",
"(",
"loadTimeParam",
")",
"&&",
"Long",
".",
"valueOf",
"(",
"loadTimeParam",
... | Validate given load time request parameter.
@param loadTimeParam string representation of load time
@return {@code true} if given load time string is numeric value and greater than 0, otherwise - {@code false} | [
"Validate",
"given",
"load",
"time",
"request",
"parameter",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java#L150-L152 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java | JSTalkBackFilter.createProducer | private OnDemandStatsProducer<PageInBrowserStats> createProducer(final String producerId, final String category, final String subsystem) {
OnDemandStatsProducer<PageInBrowserStats> producer = limit == -1 ? new OnDemandStatsProducer<PageInBrowserStats>(producerId, category, subsystem, new PageInBrowserStatsFactory()) ... | java | private OnDemandStatsProducer<PageInBrowserStats> createProducer(final String producerId, final String category, final String subsystem) {
OnDemandStatsProducer<PageInBrowserStats> producer = limit == -1 ? new OnDemandStatsProducer<PageInBrowserStats>(producerId, category, subsystem, new PageInBrowserStatsFactory()) ... | [
"private",
"OnDemandStatsProducer",
"<",
"PageInBrowserStats",
">",
"createProducer",
"(",
"final",
"String",
"producerId",
",",
"final",
"String",
"category",
",",
"final",
"String",
"subsystem",
")",
"{",
"OnDemandStatsProducer",
"<",
"PageInBrowserStats",
">",
"pro... | Creates producer with given producer id, category and subsystem and register it in producer registry.
@param producerId id of the producer
@param category name of the category
@param subsystem name of the subsystem
@return PageInBrowserStats producer | [
"Creates",
"producer",
"with",
"given",
"producer",
"id",
"category",
"and",
"subsystem",
"and",
"register",
"it",
"in",
"producer",
"registry",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java#L196-L202 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java | JSTalkBackFilter.isLong | private boolean isLong(final String str) {
try {
Long.valueOf(str);
return true;
} catch (NumberFormatException e) {
return false;
}
} | java | private boolean isLong(final String str) {
try {
Long.valueOf(str);
return true;
} catch (NumberFormatException e) {
return false;
}
} | [
"private",
"boolean",
"isLong",
"(",
"final",
"String",
"str",
")",
"{",
"try",
"{",
"Long",
".",
"valueOf",
"(",
"str",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"return",
"false",
";",
"}",
"}"
] | Checks if given string is long.
@param str {@link String}
@return true if it is long or false otherwise | [
"Checks",
"if",
"given",
"string",
"is",
"long",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java#L257-L264 | train |
anotheria/moskito | moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationtemplate/MailTemplateProcessor.java | MailTemplateProcessor.processingAllowed | private boolean processingAllowed(final String prefix, final String variable, final TemplateReplacementContext context) {
return (PREFIX.equals(prefix) && !StringUtils.isEmpty(variable) && context instanceof MailTemplateReplacementContext);
} | java | private boolean processingAllowed(final String prefix, final String variable, final TemplateReplacementContext context) {
return (PREFIX.equals(prefix) && !StringUtils.isEmpty(variable) && context instanceof MailTemplateReplacementContext);
} | [
"private",
"boolean",
"processingAllowed",
"(",
"final",
"String",
"prefix",
",",
"final",
"String",
"variable",
",",
"final",
"TemplateReplacementContext",
"context",
")",
"{",
"return",
"(",
"PREFIX",
".",
"equals",
"(",
"prefix",
")",
"&&",
"!",
"StringUtils"... | Checks whether processing is allowed.
@param prefix variable prefix
@param context {@link TemplateReplacementContext}
@return {@code boolean} flag | [
"Checks",
"whether",
"processing",
"is",
"allowed",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationtemplate/MailTemplateProcessor.java#L44-L46 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/logging/LoggerUtil.java | LoggerUtil.createSLF4JIntervalStatsLoggerForAllConfiguredIntervals | public static final void createSLF4JIntervalStatsLoggerForAllConfiguredIntervals(IStatsProducer producer, String loggerNamePrefix){
List<String> configuredIntervals = MoskitoConfigurationHolder.getConfiguration().getConfiguredIntervalNames();
for (String intervalName : configuredIntervals){
new IntervalStatsLogg... | java | public static final void createSLF4JIntervalStatsLoggerForAllConfiguredIntervals(IStatsProducer producer, String loggerNamePrefix){
List<String> configuredIntervals = MoskitoConfigurationHolder.getConfiguration().getConfiguredIntervalNames();
for (String intervalName : configuredIntervals){
new IntervalStatsLogg... | [
"public",
"static",
"final",
"void",
"createSLF4JIntervalStatsLoggerForAllConfiguredIntervals",
"(",
"IStatsProducer",
"producer",
",",
"String",
"loggerNamePrefix",
")",
"{",
"List",
"<",
"String",
">",
"configuredIntervals",
"=",
"MoskitoConfigurationHolder",
".",
"getCon... | Creates interval stats loggers for all configured intervals. Every logger is attached to a logger with name
loggerNamePrefix<intervalName>. If loggerNamePrefix is for example 'foo' then all loggers are attached to
foo1m, foo5m, foo15m etc, for all configured intervals.
@param producer producer to attach loggers t... | [
"Creates",
"interval",
"stats",
"loggers",
"for",
"all",
"configured",
"intervals",
".",
"Every",
"logger",
"is",
"attached",
"to",
"a",
"logger",
"with",
"name",
"loggerNamePrefix<",
";",
"intervalName>",
";",
".",
"If",
"loggerNamePrefix",
"is",
"for",
"ex... | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/logging/LoggerUtil.java#L41-L48 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/api/GaugeAPIImpl.java | GaugeAPIImpl.createDefaultZones | private List<GaugeZoneAO> createDefaultZones(){
ArrayList<GaugeZoneAO> ret = new ArrayList<>(1);
GaugeZoneAO redZone = new GaugeZoneAO();
redZone.setColor("red");
redZone.setLeft(0.9f);
redZone.setRight(1.0f);
ret.add(redZone);
return ret;
} | java | private List<GaugeZoneAO> createDefaultZones(){
ArrayList<GaugeZoneAO> ret = new ArrayList<>(1);
GaugeZoneAO redZone = new GaugeZoneAO();
redZone.setColor("red");
redZone.setLeft(0.9f);
redZone.setRight(1.0f);
ret.add(redZone);
return ret;
} | [
"private",
"List",
"<",
"GaugeZoneAO",
">",
"createDefaultZones",
"(",
")",
"{",
"ArrayList",
"<",
"GaugeZoneAO",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
"1",
")",
";",
"GaugeZoneAO",
"redZone",
"=",
"new",
"GaugeZoneAO",
"(",
")",
";",
"redZone",
... | This method creates some default zones if nothing is configured.
@return | [
"This",
"method",
"creates",
"some",
"default",
"zones",
"if",
"nothing",
"is",
"configured",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/api/GaugeAPIImpl.java#L70-L78 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/dynamic/MoskitoInvokationProxy.java | MoskitoInvokationProxy.guessExceptions | private void guessExceptions(){
List<Class<?>> tmpExceptionList = new ArrayList<>();
for (Class<?> c:supportedInterfaces){
Method[] methods = c.getDeclaredMethods();
for (Method m:methods){
for (Class<?> exc : m.getExceptionTypes()){
if (!tmpExceptionList.contains(exc))
tmpExceptionList.add(exc... | java | private void guessExceptions(){
List<Class<?>> tmpExceptionList = new ArrayList<>();
for (Class<?> c:supportedInterfaces){
Method[] methods = c.getDeclaredMethods();
for (Method m:methods){
for (Class<?> exc : m.getExceptionTypes()){
if (!tmpExceptionList.contains(exc))
tmpExceptionList.add(exc... | [
"private",
"void",
"guessExceptions",
"(",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"tmpExceptionList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"c",
":",
"supportedInterfaces",
")",
"{",
"Method",
... | Looks up all possible exceptions. | [
"Looks",
"up",
"all",
"possible",
"exceptions",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/dynamic/MoskitoInvokationProxy.java#L171-L184 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java | BuiltInErrorProducer.init | private void init(){
errorProducerEnabled = MoskitoConfigurationHolder.getConfiguration().getBuiltinProducersConfig().isErrorProducer();
statsMap = new ConcurrentHashMap<>();
statsList = new CopyOnWriteArrayList<>();
cumulatedStats = new ErrorStats("cumulated");
statsList.add(cumulatedStats);
catc... | java | private void init(){
errorProducerEnabled = MoskitoConfigurationHolder.getConfiguration().getBuiltinProducersConfig().isErrorProducer();
statsMap = new ConcurrentHashMap<>();
statsList = new CopyOnWriteArrayList<>();
cumulatedStats = new ErrorStats("cumulated");
statsList.add(cumulatedStats);
catc... | [
"private",
"void",
"init",
"(",
")",
"{",
"errorProducerEnabled",
"=",
"MoskitoConfigurationHolder",
".",
"getConfiguration",
"(",
")",
".",
"getBuiltinProducersConfig",
"(",
")",
".",
"isErrorProducer",
"(",
")",
";",
"statsMap",
"=",
"new",
"ConcurrentHashMap",
... | Initialization. Moved out to be reused in unit-tests. | [
"Initialization",
".",
"Moved",
"out",
"to",
"be",
"reused",
"in",
"unit",
"-",
"tests",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java#L84-L119 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java | BuiltInErrorProducer.createAccumulatorDefinition | private AccumulatorDefinition createAccumulatorDefinition(String name, String valueName, String statName){
AccumulatorDefinition definition = new AccumulatorDefinition();
definition.setName(name);
definition.setProducerName(getProducerId());
definition.setStatName(statName);
definition.setValueName(valueName)... | java | private AccumulatorDefinition createAccumulatorDefinition(String name, String valueName, String statName){
AccumulatorDefinition definition = new AccumulatorDefinition();
definition.setName(name);
definition.setProducerName(getProducerId());
definition.setStatName(statName);
definition.setValueName(valueName)... | [
"private",
"AccumulatorDefinition",
"createAccumulatorDefinition",
"(",
"String",
"name",
",",
"String",
"valueName",
",",
"String",
"statName",
")",
"{",
"AccumulatorDefinition",
"definition",
"=",
"new",
"AccumulatorDefinition",
"(",
")",
";",
"definition",
".",
"se... | Helper method to create a accumulator definiton.
@param name name of the accumulator.
@param valueName name of the value (initial or total).
@param statName name of the stat (exception name or 'cumulated').
@return | [
"Helper",
"method",
"to",
"create",
"a",
"accumulator",
"definiton",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java#L128-L136 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java | BuiltInErrorProducer.afterConfiguration | public void afterConfiguration(ErrorHandlingConfig errorHandlingConfig) {
if (!errorProducerEnabled)
return;
this.errorHandlingConfig = errorHandlingConfig;
//first create default-catchers
ErrorCatcherConfig[] defaultCatcherConfigs = errorHandlingConfig.getDefaultCatchers();
if (defaultCatcherConfigs != ... | java | public void afterConfiguration(ErrorHandlingConfig errorHandlingConfig) {
if (!errorProducerEnabled)
return;
this.errorHandlingConfig = errorHandlingConfig;
//first create default-catchers
ErrorCatcherConfig[] defaultCatcherConfigs = errorHandlingConfig.getDefaultCatchers();
if (defaultCatcherConfigs != ... | [
"public",
"void",
"afterConfiguration",
"(",
"ErrorHandlingConfig",
"errorHandlingConfig",
")",
"{",
"if",
"(",
"!",
"errorProducerEnabled",
")",
"return",
";",
"this",
".",
"errorHandlingConfig",
"=",
"errorHandlingConfig",
";",
"//first create default-catchers",
"ErrorC... | Called from the error handling config instance, after a configuration update or initial configuration.
@param errorHandlingConfig | [
"Called",
"from",
"the",
"error",
"handling",
"config",
"instance",
"after",
"a",
"configuration",
"update",
"or",
"initial",
"configuration",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java#L259-L288 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/util/SessionThrottleFilter.java | SessionThrottleFilter.getConfigFromConfigureMe | private SessionThrottleFilterConfig getConfigFromConfigureMe(){
SessionThrottleFilterConfig config = new SessionThrottleFilterConfig();
try{
ConfigurationManager.INSTANCE.configure(config);
}catch(IllegalArgumentException e){
log.warn("Incompatible configuration selected, configureme as source choosen, but ... | java | private SessionThrottleFilterConfig getConfigFromConfigureMe(){
SessionThrottleFilterConfig config = new SessionThrottleFilterConfig();
try{
ConfigurationManager.INSTANCE.configure(config);
}catch(IllegalArgumentException e){
log.warn("Incompatible configuration selected, configureme as source choosen, but ... | [
"private",
"SessionThrottleFilterConfig",
"getConfigFromConfigureMe",
"(",
")",
"{",
"SessionThrottleFilterConfig",
"config",
"=",
"new",
"SessionThrottleFilterConfig",
"(",
")",
";",
"try",
"{",
"ConfigurationManager",
".",
"INSTANCE",
".",
"configure",
"(",
"config",
... | Reads config via configureme from sessionthrottle.json.
@return | [
"Reads",
"config",
"via",
"configureme",
"from",
"sessionthrottle",
".",
"json",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/util/SessionThrottleFilter.java#L78-L86 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/util/SessionThrottleFilter.java | SessionThrottleFilter.getConfigFromWebXML | private SessionThrottleFilterConfig getConfigFromWebXML(FilterConfig filterConfig){
int limit = -1;
String l = filterConfig.getInitParameter("limit");
try{
if (l!=null)
limit = Integer.parseInt(l);
}catch(NumberFormatException ignored){
//ignored.
}
String target = filterConfig.getInitParameter(... | java | private SessionThrottleFilterConfig getConfigFromWebXML(FilterConfig filterConfig){
int limit = -1;
String l = filterConfig.getInitParameter("limit");
try{
if (l!=null)
limit = Integer.parseInt(l);
}catch(NumberFormatException ignored){
//ignored.
}
String target = filterConfig.getInitParameter(... | [
"private",
"SessionThrottleFilterConfig",
"getConfigFromWebXML",
"(",
"FilterConfig",
"filterConfig",
")",
"{",
"int",
"limit",
"=",
"-",
"1",
";",
"String",
"l",
"=",
"filterConfig",
".",
"getInitParameter",
"(",
"\"limit\"",
")",
";",
"try",
"{",
"if",
"(",
... | Reads config from web.xml.
@param filterConfig
@return | [
"Reads",
"config",
"from",
"web",
".",
"xml",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/util/SessionThrottleFilter.java#L93-L110 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/StatusData.java | StatusData.put | public void put(T key, Object value) {
data.put(key, ensureValueCorrectness(key, value));
} | java | public void put(T key, Object value) {
data.put(key, ensureValueCorrectness(key, value));
} | [
"public",
"void",
"put",
"(",
"T",
"key",
",",
"Object",
"value",
")",
"{",
"data",
".",
"put",
"(",
"key",
",",
"ensureValueCorrectness",
"(",
"key",
",",
"value",
")",
")",
";",
"}"
] | Stores given key-value mapping if no restrictions are violated by them.
@param key mapping key.
@param value mapping value.
@throws IllegalArgumentException if the given key is {@code null} or if value is neither of correct type nor of String type. | [
"Stores",
"given",
"key",
"-",
"value",
"mapping",
"if",
"no",
"restrictions",
"are",
"violated",
"by",
"them",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/StatusData.java#L31-L33 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/StatusData.java | StatusData.ensureValueCorrectness | private Object ensureValueCorrectness(T key, Object value) {
checkKey(key);
if (key.isCorrectValue(value) || value == null) {
return value;
}
if (value instanceof String) {
value = key.parseValue(String.class.cast(value));
return value;
}
... | java | private Object ensureValueCorrectness(T key, Object value) {
checkKey(key);
if (key.isCorrectValue(value) || value == null) {
return value;
}
if (value instanceof String) {
value = key.parseValue(String.class.cast(value));
return value;
}
... | [
"private",
"Object",
"ensureValueCorrectness",
"(",
"T",
"key",
",",
"Object",
"value",
")",
"{",
"checkKey",
"(",
"key",
")",
";",
"if",
"(",
"key",
".",
"isCorrectValue",
"(",
"value",
")",
"||",
"value",
"==",
"null",
")",
"{",
"return",
"value",
";... | Ensure that value is of correct type for the given key.
If value is not already of correct type but of type String, attempt parsing into correct type.
@return provided value if it's correctly typed or parsed value of correct type or {@code null} if auto-conversion failed.
@throws IllegalArgumentException if the given k... | [
"Ensure",
"that",
"value",
"is",
"of",
"correct",
"type",
"for",
"the",
"given",
"key",
".",
"If",
"value",
"is",
"not",
"already",
"of",
"correct",
"type",
"but",
"of",
"type",
"String",
"attempt",
"parsing",
"into",
"correct",
"type",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/StatusData.java#L65-L75 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseAJAXMoskitoUIAction.java | BaseAJAXMoskitoUIAction.invokeExecute | protected void invokeExecute(final ActionMapping mapping, final FormBean bean, final HttpServletRequest req, final HttpServletResponse res, final JSONResponse jsonResponse)
throws Exception {
} | java | protected void invokeExecute(final ActionMapping mapping, final FormBean bean, final HttpServletRequest req, final HttpServletResponse res, final JSONResponse jsonResponse)
throws Exception {
} | [
"protected",
"void",
"invokeExecute",
"(",
"final",
"ActionMapping",
"mapping",
",",
"final",
"FormBean",
"bean",
",",
"final",
"HttpServletRequest",
"req",
",",
"final",
"HttpServletResponse",
"res",
",",
"final",
"JSONResponse",
"jsonResponse",
")",
"throws",
"Exc... | Override this method for invoking main action code.
@param mapping
- action mapping
@param bean
- bean
@param req
- request
@param res
- response
@param jsonResponse
- JSON Response
@throws Exception on errors | [
"Override",
"this",
"method",
"for",
"invoking",
"main",
"action",
"code",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseAJAXMoskitoUIAction.java#L83-L86 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.update | public void update(StatusData<T> status) {
if (status == null) {
throw new IllegalArgumentException("Received null as status data!");
}
neverUpdated = false;
handleStatsResetIfNeeded(status);
for (T metric : metrics) {
Object value = status.get(metric);
... | java | public void update(StatusData<T> status) {
if (status == null) {
throw new IllegalArgumentException("Received null as status data!");
}
neverUpdated = false;
handleStatsResetIfNeeded(status);
for (T metric : metrics) {
Object value = status.get(metric);
... | [
"public",
"void",
"update",
"(",
"StatusData",
"<",
"T",
">",
"status",
")",
"{",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Received null as status data!\"",
")",
";",
"}",
"neverUpdated",
"=",
"false",
... | Update this stats with new data contained in StatusData parameter.
@param status {@link StatusData} object containing new data.
@throws IllegalArgumentException if given status is null. | [
"Update",
"this",
"stats",
"with",
"new",
"data",
"contained",
"in",
"StatusData",
"parameter",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L100-L123 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.getStatValueAsLong | public long getStatValueAsLong(T metric, String interval) {
if (metric.isRateMetric()) {
return (long)(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsLong(interval);
} | java | public long getStatValueAsLong(T metric, String interval) {
if (metric.isRateMetric()) {
return (long)(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsLong(interval);
} | [
"public",
"long",
"getStatValueAsLong",
"(",
"T",
"metric",
",",
"String",
"interval",
")",
"{",
"if",
"(",
"metric",
".",
"isRateMetric",
"(",
")",
")",
"{",
"return",
"(",
"long",
")",
"(",
"getStatValueAsDouble",
"(",
"metric",
",",
"interval",
")",
"... | Get value of provided metric for the given interval as long value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value | [
"Get",
"value",
"of",
"provided",
"metric",
"for",
"the",
"given",
"interval",
"as",
"long",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L165-L170 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.getStatValueAsInteger | public int getStatValueAsInteger(T metric, String interval) {
if (metric.isRateMetric()) {
return (int)(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsInt(interval);
} | java | public int getStatValueAsInteger(T metric, String interval) {
if (metric.isRateMetric()) {
return (int)(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsInt(interval);
} | [
"public",
"int",
"getStatValueAsInteger",
"(",
"T",
"metric",
",",
"String",
"interval",
")",
"{",
"if",
"(",
"metric",
".",
"isRateMetric",
"(",
")",
")",
"{",
"return",
"(",
"int",
")",
"(",
"getStatValueAsDouble",
"(",
"metric",
",",
"interval",
")",
... | Get value of provided metric for the given interval as int value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value | [
"Get",
"value",
"of",
"provided",
"metric",
"for",
"the",
"given",
"interval",
"as",
"int",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L178-L183 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.getStatValueAsString | public String getStatValueAsString(T metric, String interval) {
if (metric.isRateMetric()) {
return String.valueOf(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsString(interval);
} | java | public String getStatValueAsString(T metric, String interval) {
if (metric.isRateMetric()) {
return String.valueOf(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsString(interval);
} | [
"public",
"String",
"getStatValueAsString",
"(",
"T",
"metric",
",",
"String",
"interval",
")",
"{",
"if",
"(",
"metric",
".",
"isRateMetric",
"(",
")",
")",
"{",
"return",
"String",
".",
"valueOf",
"(",
"getStatValueAsDouble",
"(",
"metric",
",",
"interval"... | Get value of provided metric for the given interval as String value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value | [
"Get",
"value",
"of",
"provided",
"metric",
"for",
"the",
"given",
"interval",
"as",
"String",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L191-L196 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.getStatValueAsDouble | public double getStatValueAsDouble(T metric, String interval) {
StatValue statValue = getMonitoredStatValue(metric);
if (metric.isRateMetric()) {
//check for DEFAULT can be removed when same check removed from statValueImpl
if("default".equals(interval)) {
interva... | java | public double getStatValueAsDouble(T metric, String interval) {
StatValue statValue = getMonitoredStatValue(metric);
if (metric.isRateMetric()) {
//check for DEFAULT can be removed when same check removed from statValueImpl
if("default".equals(interval)) {
interva... | [
"public",
"double",
"getStatValueAsDouble",
"(",
"T",
"metric",
",",
"String",
"interval",
")",
"{",
"StatValue",
"statValue",
"=",
"getMonitoredStatValue",
"(",
"metric",
")",
";",
"if",
"(",
"metric",
".",
"isRateMetric",
"(",
")",
")",
"{",
"//check for DEF... | Get value of provided metric for the given interval as double value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value | [
"Get",
"value",
"of",
"provided",
"metric",
"for",
"the",
"given",
"interval",
"as",
"double",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L204-L218 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/api/JourneyCallIntermediateContainer.java | JourneyCallIntermediateContainer.add | public void add(TracedCallStepAO step){
elements.add(step);
step.setId((counter++));
ReversedCallHelper helper = stepsReversed.get(step.getCall());
if (helper == null){
helper = new ReversedCallHelper();
stepsReversed.put(step.getCall(), helper);
}
helper.add(step.getNiceId(), step.getTimespent(), ... | java | public void add(TracedCallStepAO step){
elements.add(step);
step.setId((counter++));
ReversedCallHelper helper = stepsReversed.get(step.getCall());
if (helper == null){
helper = new ReversedCallHelper();
stepsReversed.put(step.getCall(), helper);
}
helper.add(step.getNiceId(), step.getTimespent(), ... | [
"public",
"void",
"add",
"(",
"TracedCallStepAO",
"step",
")",
"{",
"elements",
".",
"add",
"(",
"step",
")",
";",
"step",
".",
"setId",
"(",
"(",
"counter",
"++",
")",
")",
";",
"ReversedCallHelper",
"helper",
"=",
"stepsReversed",
".",
"get",
"(",
"s... | Adds a new TracedCallStepAO.
@param step | [
"Adds",
"a",
"new",
"TracedCallStepAO",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/api/JourneyCallIntermediateContainer.java#L41-L52 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/accumulators/resource/AccumulatorResource.java | AccumulatorResource.getAccumulators | @GET
public ReplyObject getAccumulators(){
try{
return ReplyObject.success("accumulators", getAccumulatorAPI().getAccumulatorDefinitions() );
}catch(APIException e){
return ReplyObject.error(e);
}
} | java | @GET
public ReplyObject getAccumulators(){
try{
return ReplyObject.success("accumulators", getAccumulatorAPI().getAccumulatorDefinitions() );
}catch(APIException e){
return ReplyObject.error(e);
}
} | [
"@",
"GET",
"public",
"ReplyObject",
"getAccumulators",
"(",
")",
"{",
"try",
"{",
"return",
"ReplyObject",
".",
"success",
"(",
"\"accumulators\"",
",",
"getAccumulatorAPI",
"(",
")",
".",
"getAccumulatorDefinitions",
"(",
")",
")",
";",
"}",
"catch",
"(",
... | Returns all accumulators.
@return | [
"Returns",
"all",
"accumulators",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/accumulators/resource/AccumulatorResource.java#L30-L37 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/accumulators/resource/AccumulatorResource.java | AccumulatorResource.deleteAccumulator | @DELETE
@Path("/{id}")
public ReplyObject deleteAccumulator(@PathParam("id") String id){
try{
getAccumulatorAPI().removeAccumulator(id);
return ReplyObject.success();
}catch(APIException e){
return ReplyObject.error(e);
}
} | java | @DELETE
@Path("/{id}")
public ReplyObject deleteAccumulator(@PathParam("id") String id){
try{
getAccumulatorAPI().removeAccumulator(id);
return ReplyObject.success();
}catch(APIException e){
return ReplyObject.error(e);
}
} | [
"@",
"DELETE",
"@",
"Path",
"(",
"\"/{id}\"",
")",
"public",
"ReplyObject",
"deleteAccumulator",
"(",
"@",
"PathParam",
"(",
"\"id\"",
")",
"String",
"id",
")",
"{",
"try",
"{",
"getAccumulatorAPI",
"(",
")",
".",
"removeAccumulator",
"(",
"id",
")",
";",
... | Removes one accumulator by id.
@param id
@return | [
"Removes",
"one",
"accumulator",
"by",
"id",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/accumulators/resource/AccumulatorResource.java#L44-L53 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/accumulators/resource/AccumulatorResource.java | AccumulatorResource.createAccumulator | @POST
public ReplyObject createAccumulator(AccumulatorPO po){
try{
AccumulatorDefinitionAO ret = getAccumulatorAPI().createAccumulator(po);
return ReplyObject.success("created", ret);
}catch(APIException e){
return ReplyObject.error(e);
}
} | java | @POST
public ReplyObject createAccumulator(AccumulatorPO po){
try{
AccumulatorDefinitionAO ret = getAccumulatorAPI().createAccumulator(po);
return ReplyObject.success("created", ret);
}catch(APIException e){
return ReplyObject.error(e);
}
} | [
"@",
"POST",
"public",
"ReplyObject",
"createAccumulator",
"(",
"AccumulatorPO",
"po",
")",
"{",
"try",
"{",
"AccumulatorDefinitionAO",
"ret",
"=",
"getAccumulatorAPI",
"(",
")",
".",
"createAccumulator",
"(",
"po",
")",
";",
"return",
"ReplyObject",
".",
"succe... | Creates new accumulator.
@param po the accumulator parameter object.
@return | [
"Creates",
"new",
"accumulator",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/accumulators/resource/AccumulatorResource.java#L112-L120 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java | IntervalRegistry.getInterval | Interval getInterval(int aId) {
Interval interval = intervalsById.get(aId);
if (interval == null) {
throw new UnknownIntervalException(aId);
}
return interval;
} | java | Interval getInterval(int aId) {
Interval interval = intervalsById.get(aId);
if (interval == null) {
throw new UnknownIntervalException(aId);
}
return interval;
} | [
"Interval",
"getInterval",
"(",
"int",
"aId",
")",
"{",
"Interval",
"interval",
"=",
"intervalsById",
".",
"get",
"(",
"aId",
")",
";",
"if",
"(",
"interval",
"==",
"null",
")",
"{",
"throw",
"new",
"UnknownIntervalException",
"(",
"aId",
")",
";",
"}",
... | This method retrieves an Interval with the given id.
@param aId the Interval id
@return the found Interval
@throws UnknownIntervalException if no Interval with the given id could be found | [
"This",
"method",
"retrieves",
"an",
"Interval",
"with",
"the",
"given",
"id",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java#L118-L124 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java | IntervalRegistry.createInterval | private Interval createInterval(String aName, int aLength) {
if (aName.equals("1m")){
System.out.println("CREATE INTERVAL 1M CALLED ");
new RuntimeException().fillInStackTrace().printStackTrace();
}
IntervalImpl interval = new IntervalImpl(obtainNextUniqueId(), aName, aLength);
if (aLength!=-1)
upda... | java | private Interval createInterval(String aName, int aLength) {
if (aName.equals("1m")){
System.out.println("CREATE INTERVAL 1M CALLED ");
new RuntimeException().fillInStackTrace().printStackTrace();
}
IntervalImpl interval = new IntervalImpl(obtainNextUniqueId(), aName, aLength);
if (aLength!=-1)
upda... | [
"private",
"Interval",
"createInterval",
"(",
"String",
"aName",
",",
"int",
"aLength",
")",
"{",
"if",
"(",
"aName",
".",
"equals",
"(",
"\"1m\"",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"CREATE INTERVAL 1M CALLED \"",
")",
";",
"new",... | This method creates a new Interval with the given name and length.
@param aName the name of the new Interval
@param aLength the length of the Interval in seconds
@return the new Interval | [
"This",
"method",
"creates",
"a",
"new",
"Interval",
"with",
"the",
"given",
"name",
"and",
"length",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java#L182-L206 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java | IntervalRegistry.getUpdateTimestamp | public Long getUpdateTimestamp(String intervalName){
return intervalName == null ? Long.valueOf(0) : intervalUpdateTimestamp.get(intervalName);
} | java | public Long getUpdateTimestamp(String intervalName){
return intervalName == null ? Long.valueOf(0) : intervalUpdateTimestamp.get(intervalName);
} | [
"public",
"Long",
"getUpdateTimestamp",
"(",
"String",
"intervalName",
")",
"{",
"return",
"intervalName",
"==",
"null",
"?",
"Long",
".",
"valueOf",
"(",
"0",
")",
":",
"intervalUpdateTimestamp",
".",
"get",
"(",
"intervalName",
")",
";",
"}"
] | Returns last update timestamp of an interval by name.
@param intervalName name of the interval.
@return returns the timestamp in milliseconds since 1970 for the interval update. | [
"Returns",
"last",
"update",
"timestamp",
"of",
"an",
"interval",
"by",
"name",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java#L229-L231 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/count/CountInterceptor.java | CountInterceptor.aroundInvoke | @AroundInvoke
@AroundTimeout
public Object aroundInvoke(InvocationContext ctx) throws Throwable {
final Method method = ctx.getMethod();
final Count annotation = getAnnotationFromContext(ctx, Count.class);
final CountParameter parameter = method.getAnnotation(CountParameter.class);
... | java | @AroundInvoke
@AroundTimeout
public Object aroundInvoke(InvocationContext ctx) throws Throwable {
final Method method = ctx.getMethod();
final Count annotation = getAnnotationFromContext(ctx, Count.class);
final CountParameter parameter = method.getAnnotation(CountParameter.class);
... | [
"@",
"AroundInvoke",
"@",
"AroundTimeout",
"public",
"Object",
"aroundInvoke",
"(",
"InvocationContext",
"ctx",
")",
"throws",
"Throwable",
"{",
"final",
"Method",
"method",
"=",
"ctx",
".",
"getMethod",
"(",
")",
";",
"final",
"Count",
"annotation",
"=",
"get... | Around method invoke.
@param ctx context
@return method result
@throws Throwable any exception | [
"Around",
"method",
"invoke",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/count/CountInterceptor.java#L47-L70 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/helper/AutoTieWrapper.java | AutoTieWrapper.update | public void update(){
if (tieable.isActivated()){
return;
}
for (IStats s : producer.getStats()) {
if (s.getName().equals(tieable.getTargetStatName())) {
tieable.tieToStats(s);
tieable.update();
return;
}
}
} | java | public void update(){
if (tieable.isActivated()){
return;
}
for (IStats s : producer.getStats()) {
if (s.getName().equals(tieable.getTargetStatName())) {
tieable.tieToStats(s);
tieable.update();
return;
}
}
} | [
"public",
"void",
"update",
"(",
")",
"{",
"if",
"(",
"tieable",
".",
"isActivated",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"IStats",
"s",
":",
"producer",
".",
"getStats",
"(",
")",
")",
"{",
"if",
"(",
"s",
".",
"getName",
"(",
"... | Called whenever the appropriate interval has passed and the stats should be updated. | [
"Called",
"whenever",
"the",
"appropriate",
"interval",
"has",
"passed",
"and",
"the",
"stats",
"should",
"be",
"updated",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/helper/AutoTieWrapper.java#L32-L43 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/threshold/ThresholdRepository.java | ThresholdRepository.getWorstStatus | public ThresholdStatus getWorstStatus(){
if (configuration.getKillSwitch().disableMetricCollection())
return ThresholdStatus.OFF;
ThresholdStatus ret = ThresholdStatus.GREEN;
for (Threshold t : getThresholds()){
if (t.getStatus().overrules(ret))
ret = t.getStatus();
}
return ret;
} | java | public ThresholdStatus getWorstStatus(){
if (configuration.getKillSwitch().disableMetricCollection())
return ThresholdStatus.OFF;
ThresholdStatus ret = ThresholdStatus.GREEN;
for (Threshold t : getThresholds()){
if (t.getStatus().overrules(ret))
ret = t.getStatus();
}
return ret;
} | [
"public",
"ThresholdStatus",
"getWorstStatus",
"(",
")",
"{",
"if",
"(",
"configuration",
".",
"getKillSwitch",
"(",
")",
".",
"disableMetricCollection",
"(",
")",
")",
"return",
"ThresholdStatus",
".",
"OFF",
";",
"ThresholdStatus",
"ret",
"=",
"ThresholdStatus",... | Returns the worst threshold status in the system.
@return the worst detected threshold status. | [
"Returns",
"the",
"worst",
"threshold",
"status",
"in",
"the",
"system",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/threshold/ThresholdRepository.java#L186-L197 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/threshold/ThresholdRepository.java | ThresholdRepository.getWorstStatus | public ThresholdStatus getWorstStatus(List<String> names){
if (configuration.getKillSwitch().disableMetricCollection())
return ThresholdStatus.OFF;
ThresholdStatus ret = ThresholdStatus.GREEN;
for (Threshold t : getThresholds()){
if (names.indexOf(t.getName())==-1)
continue;
if (t.getStatus().overru... | java | public ThresholdStatus getWorstStatus(List<String> names){
if (configuration.getKillSwitch().disableMetricCollection())
return ThresholdStatus.OFF;
ThresholdStatus ret = ThresholdStatus.GREEN;
for (Threshold t : getThresholds()){
if (names.indexOf(t.getName())==-1)
continue;
if (t.getStatus().overru... | [
"public",
"ThresholdStatus",
"getWorstStatus",
"(",
"List",
"<",
"String",
">",
"names",
")",
"{",
"if",
"(",
"configuration",
".",
"getKillSwitch",
"(",
")",
".",
"disableMetricCollection",
"(",
")",
")",
"return",
"ThresholdStatus",
".",
"OFF",
";",
"Thresho... | Returns the worst threshold status in the system for given threshold names.
@return | [
"Returns",
"the",
"worst",
"threshold",
"status",
"in",
"the",
"system",
"for",
"given",
"threshold",
"names",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/threshold/ThresholdRepository.java#L211-L224 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/threshold/ThresholdRepository.java | ThresholdRepository.readConfig | private void readConfig(){
configuration = MoskitoConfigurationHolder.getConfiguration();
ThresholdsConfig config = configuration.getThresholdsConfig();
ThresholdConfig[] tcs = config.getThresholds();
if (tcs!=null && tcs.length>0){
for (ThresholdConfig tc : tcs){
ThresholdDefinition td = new ThresholdD... | java | private void readConfig(){
configuration = MoskitoConfigurationHolder.getConfiguration();
ThresholdsConfig config = configuration.getThresholdsConfig();
ThresholdConfig[] tcs = config.getThresholds();
if (tcs!=null && tcs.length>0){
for (ThresholdConfig tc : tcs){
ThresholdDefinition td = new ThresholdD... | [
"private",
"void",
"readConfig",
"(",
")",
"{",
"configuration",
"=",
"MoskitoConfigurationHolder",
".",
"getConfiguration",
"(",
")",
";",
"ThresholdsConfig",
"config",
"=",
"configuration",
".",
"getThresholdsConfig",
"(",
")",
";",
"ThresholdConfig",
"[",
"]",
... | Reads the config and creates configured thresholds. For now this method is only executed on startup. | [
"Reads",
"the",
"config",
"and",
"creates",
"configured",
"thresholds",
".",
"For",
"now",
"this",
"method",
"is",
"only",
"executed",
"on",
"startup",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/threshold/ThresholdRepository.java#L264-L301 | train |
anotheria/moskito | moskito-extensions/moskito-disk-space-monitoring/src/main/java/net/anotheria/moskito/extensions/diskspacemonitoring/DiscSpaceProducer.java | DiscSpaceProducer.readMemory | private void readMemory() {
long space;
try {
space = root.getUsableSpace();
} catch (IOException e) {
log.error("Querying space. Querying error: " + e.toString());
return;
}
stats.updateMemoryValue(space);
} | java | private void readMemory() {
long space;
try {
space = root.getUsableSpace();
} catch (IOException e) {
log.error("Querying space. Querying error: " + e.toString());
return;
}
stats.updateMemoryValue(space);
} | [
"private",
"void",
"readMemory",
"(",
")",
"{",
"long",
"space",
";",
"try",
"{",
"space",
"=",
"root",
".",
"getUsableSpace",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"log",
".",
"error",
"(",
"\"Querying space. Querying error: \"",... | Reads the memory value from the resolver and updates internal stats. | [
"Reads",
"the",
"memory",
"value",
"from",
"the",
"resolver",
"and",
"updates",
"internal",
"stats",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-disk-space-monitoring/src/main/java/net/anotheria/moskito/extensions/diskspacemonitoring/DiscSpaceProducer.java#L92-L101 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/PluginTypeRegistry.java | PluginTypeRegistry.registerPluginType | public static <T> void registerPluginType(String pluginType, StatsFactory statsFactory, StatusFetcherFactory<T> statusFetcherFactory, StatusParser<T,StatusData> parser) {
PluginTypeConfiguration conf = new PluginTypeConfiguration<>(statsFactory, statusFetcherFactory, parser);
PluginTypeConfiguration pre... | java | public static <T> void registerPluginType(String pluginType, StatsFactory statsFactory, StatusFetcherFactory<T> statusFetcherFactory, StatusParser<T,StatusData> parser) {
PluginTypeConfiguration conf = new PluginTypeConfiguration<>(statsFactory, statusFetcherFactory, parser);
PluginTypeConfiguration pre... | [
"public",
"static",
"<",
"T",
">",
"void",
"registerPluginType",
"(",
"String",
"pluginType",
",",
"StatsFactory",
"statsFactory",
",",
"StatusFetcherFactory",
"<",
"T",
">",
"statusFetcherFactory",
",",
"StatusParser",
"<",
"T",
",",
"StatusData",
">",
"parser",
... | Register plugin type and associate given factories with it.
@param pluginType plugin type: "apache"/"nginx"/etc..
@param statsFactory factory that creates corresponding stats.
@param statusFetcherFactory factory that creates {@link StatusFetcher} for the given plugin type.
@param parser parser instance that can parse s... | [
"Register",
"plugin",
"type",
"and",
"associate",
"given",
"factories",
"with",
"it",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/PluginTypeRegistry.java#L34-L40 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/bean/AlertBean.java | AlertBean.create | public static AlertBean create(AlertType type, String message) {
AlertBean result = new AlertBean(type, message);
result.setAnimate(false);
result.setFullWidth(true);
result.setRoundBorders(false);
return result;
} | java | public static AlertBean create(AlertType type, String message) {
AlertBean result = new AlertBean(type, message);
result.setAnimate(false);
result.setFullWidth(true);
result.setRoundBorders(false);
return result;
} | [
"public",
"static",
"AlertBean",
"create",
"(",
"AlertType",
"type",
",",
"String",
"message",
")",
"{",
"AlertBean",
"result",
"=",
"new",
"AlertBean",
"(",
"type",
",",
"message",
")",
";",
"result",
".",
"setAnimate",
"(",
"false",
")",
";",
"result",
... | Creates default alert without animation, with square borders and full width. | [
"Creates",
"default",
"alert",
"without",
"animation",
"with",
"square",
"borders",
"and",
"full",
"width",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/bean/AlertBean.java#L64-L70 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/fetcher/HttpHelper.java | HttpHelper.getHttpResponse | public static HttpResponse getHttpResponse(String url, UsernamePasswordCredentials credentials) throws IOException {
HttpGet request = new HttpGet(url);
if (credentials != null) {
URI uri = request.getURI();
AuthScope authScope = new AuthScope(uri.getHost(), uri.getPort());
... | java | public static HttpResponse getHttpResponse(String url, UsernamePasswordCredentials credentials) throws IOException {
HttpGet request = new HttpGet(url);
if (credentials != null) {
URI uri = request.getURI();
AuthScope authScope = new AuthScope(uri.getHost(), uri.getPort());
... | [
"public",
"static",
"HttpResponse",
"getHttpResponse",
"(",
"String",
"url",
",",
"UsernamePasswordCredentials",
"credentials",
")",
"throws",
"IOException",
"{",
"HttpGet",
"request",
"=",
"new",
"HttpGet",
"(",
"url",
")",
";",
"if",
"(",
"credentials",
"!=",
... | Executes a request using the given URL and credentials.
@param url the http URL to connect to.
@param credentials credentials to use
@return the response to the request.
@throws IOException in case of a problem or the connection was aborted
@throws ClientProtocolException in case of an http protocol error | [
"Executes",
"a",
"request",
"using",
"the",
"given",
"URL",
"and",
"credentials",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/fetcher/HttpHelper.java#L95-L106 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/fetcher/HttpHelper.java | HttpHelper.areSame | private static boolean areSame(Credentials c1, Credentials c2) {
if (c1 == null) {
return c2 == null;
} else {
return StringUtils.equals(c1.getUserPrincipal().getName(), c1.getUserPrincipal().getName()) &&
StringUtils.equals(c1.getPassword(), c1.getPassword())... | java | private static boolean areSame(Credentials c1, Credentials c2) {
if (c1 == null) {
return c2 == null;
} else {
return StringUtils.equals(c1.getUserPrincipal().getName(), c1.getUserPrincipal().getName()) &&
StringUtils.equals(c1.getPassword(), c1.getPassword())... | [
"private",
"static",
"boolean",
"areSame",
"(",
"Credentials",
"c1",
",",
"Credentials",
"c2",
")",
"{",
"if",
"(",
"c1",
"==",
"null",
")",
"{",
"return",
"c2",
"==",
"null",
";",
"}",
"else",
"{",
"return",
"StringUtils",
".",
"equals",
"(",
"c1",
... | Compare two instances of Credentials.
@param c1 instance of Credentials
@param c2 another instance of Credentials
@return comparison result. {@code true} if both are null or contain same user/password pairs, false otherwise. | [
"Compare",
"two",
"instances",
"of",
"Credentials",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/fetcher/HttpHelper.java#L114-L121 | train |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/fetcher/HttpHelper.java | HttpHelper.getResponseContent | public static String getResponseContent(HttpResponse response) throws IOException {
final HttpEntity entity = response.getEntity();
if (entity != null) {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
entity.writeTo(out);//call this in any case... | java | public static String getResponseContent(HttpResponse response) throws IOException {
final HttpEntity entity = response.getEntity();
if (entity != null) {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
entity.writeTo(out);//call this in any case... | [
"public",
"static",
"String",
"getResponseContent",
"(",
"HttpResponse",
"response",
")",
"throws",
"IOException",
"{",
"final",
"HttpEntity",
"entity",
"=",
"response",
".",
"getEntity",
"(",
")",
";",
"if",
"(",
"entity",
"!=",
"null",
")",
"{",
"try",
"{"... | Get text content from the response if response status code is 200.
@param response instance of HttpResponse.
@return String representation of HttpEntity.
@throws IOException if an I/O error occurs
@see #isScOk(HttpResponse) | [
"Get",
"text",
"content",
"from",
"the",
"response",
"if",
"response",
"status",
"code",
"is",
"200",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/fetcher/HttpHelper.java#L140-L154 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/threshold/Threshold.java | Threshold.toConfigObject | public ThresholdConfig toConfigObject(){
ThresholdConfig ret = new ThresholdConfig();
ret.setIntervalName(getDefinition().getIntervalName());
ret.setName(getDefinition().getName());
ret.setProducerName(getDefinition().getProducerName());
ret.setStatName(getDefinition().getStatName());
ret.setValueName(getDe... | java | public ThresholdConfig toConfigObject(){
ThresholdConfig ret = new ThresholdConfig();
ret.setIntervalName(getDefinition().getIntervalName());
ret.setName(getDefinition().getName());
ret.setProducerName(getDefinition().getProducerName());
ret.setStatName(getDefinition().getStatName());
ret.setValueName(getDe... | [
"public",
"ThresholdConfig",
"toConfigObject",
"(",
")",
"{",
"ThresholdConfig",
"ret",
"=",
"new",
"ThresholdConfig",
"(",
")",
";",
"ret",
".",
"setIntervalName",
"(",
"getDefinition",
"(",
")",
".",
"getIntervalName",
"(",
")",
")",
";",
"ret",
".",
"setN... | This method allows to recreate proper configuration object for this threshold.
@return | [
"This",
"method",
"allows",
"to",
"recreate",
"proper",
"configuration",
"object",
"for",
"this",
"threshold",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/threshold/Threshold.java#L207-L216 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/CurrentlyTracedCall.java | CurrentlyTracedCall.startStep | public TraceStep startStep(String call, IStatsProducer producer, String methodName){
TraceStep last = current;
current = new TraceStep(call, producer, methodName);
//it actually happened in production, we are still investigating why, but this fix should at least prevent the NPE for now.
if (last!=null)
last.... | java | public TraceStep startStep(String call, IStatsProducer producer, String methodName){
TraceStep last = current;
current = new TraceStep(call, producer, methodName);
//it actually happened in production, we are still investigating why, but this fix should at least prevent the NPE for now.
if (last!=null)
last.... | [
"public",
"TraceStep",
"startStep",
"(",
"String",
"call",
",",
"IStatsProducer",
"producer",
",",
"String",
"methodName",
")",
"{",
"TraceStep",
"last",
"=",
"current",
";",
"current",
"=",
"new",
"TraceStep",
"(",
"call",
",",
"producer",
",",
"methodName",
... | Creates a new sub step in current call. | [
"Creates",
"a",
"new",
"sub",
"step",
"in",
"current",
"call",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/CurrentlyTracedCall.java#L113-L120 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/CurrentlyTracedCall.java | CurrentlyTracedCall.getNumberOfSteps | public int getNumberOfSteps() {
int result = 0;
final Queue<TraceStep> queue = new LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
final TraceStep currentTraceStep = queue.poll();
result++;
final List<TraceStep> children = currentTraceStep.getChildren();
if (!children.isEmpty()) {
... | java | public int getNumberOfSteps() {
int result = 0;
final Queue<TraceStep> queue = new LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
final TraceStep currentTraceStep = queue.poll();
result++;
final List<TraceStep> children = currentTraceStep.getChildren();
if (!children.isEmpty()) {
... | [
"public",
"int",
"getNumberOfSteps",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"final",
"Queue",
"<",
"TraceStep",
">",
"queue",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"queue",
".",
"add",
"(",
"root",
")",
";",
"while",
"(",
"!",
"que... | Calculates the number of steps.
@return the number of steps | [
"Calculates",
"the",
"number",
"of",
"steps",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/CurrentlyTracedCall.java#L190-L208 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/CurrentlyTracedCall.java | CurrentlyTracedCall.dumpOut | public void dumpOut(){
System.out.println(this.toString());
TraceStep root = getRootStep();
dumpOut(root, 1);
} | java | public void dumpOut(){
System.out.println(this.toString());
TraceStep root = getRootStep();
dumpOut(root, 1);
} | [
"public",
"void",
"dumpOut",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"this",
".",
"toString",
"(",
")",
")",
";",
"TraceStep",
"root",
"=",
"getRootStep",
"(",
")",
";",
"dumpOut",
"(",
"root",
",",
"1",
")",
";",
"}"
] | This is a debug method used to dump out the call into stdout. | [
"This",
"is",
"a",
"debug",
"method",
"used",
"to",
"dump",
"out",
"the",
"call",
"into",
"stdout",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/CurrentlyTracedCall.java#L213-L217 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryFactory.java | ProducerRegistryFactory.init | private static void init(){
String junittest = System.getProperty("JUNITTEST");
if (junittest!=null && (junittest.equalsIgnoreCase("true")))
return;
StartBuiltInProducers.startbuiltin();
//ensure plugins are loaded.
PluginRepository.getInstance();
//ensure accumulators are initialized.
AccumulatorRepos... | java | private static void init(){
String junittest = System.getProperty("JUNITTEST");
if (junittest!=null && (junittest.equalsIgnoreCase("true")))
return;
StartBuiltInProducers.startbuiltin();
//ensure plugins are loaded.
PluginRepository.getInstance();
//ensure accumulators are initialized.
AccumulatorRepos... | [
"private",
"static",
"void",
"init",
"(",
")",
"{",
"String",
"junittest",
"=",
"System",
".",
"getProperty",
"(",
"\"JUNITTEST\"",
")",
";",
"if",
"(",
"junittest",
"!=",
"null",
"&&",
"(",
"junittest",
".",
"equalsIgnoreCase",
"(",
"\"true\"",
")",
")",
... | Initializes the registry. If we are not in junit mode, start built-in producers. | [
"Initializes",
"the",
"registry",
".",
"If",
"we",
"are",
"not",
"in",
"junit",
"mode",
"start",
"built",
"-",
"in",
"producers",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryFactory.java#L60-L71 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/config/producers/BuiltinProducersConfig.java | BuiltinProducersConfig.disableAll | public void disableAll(){
javaMemoryProducers =
javaMemoryPoolProducers =
javaThreadingProducers =
osProducer =
runtimeProducer =
mbeanProducers =
gcProducer =
errorProducer =
false;
} | java | public void disableAll(){
javaMemoryProducers =
javaMemoryPoolProducers =
javaThreadingProducers =
osProducer =
runtimeProducer =
mbeanProducers =
gcProducer =
errorProducer =
false;
} | [
"public",
"void",
"disableAll",
"(",
")",
"{",
"javaMemoryProducers",
"=",
"javaMemoryPoolProducers",
"=",
"javaThreadingProducers",
"=",
"osProducer",
"=",
"runtimeProducer",
"=",
"mbeanProducers",
"=",
"gcProducer",
"=",
"errorProducer",
"=",
"false",
";",
"}"
] | this method is for unit-test. | [
"this",
"method",
"is",
"for",
"unit",
"-",
"test",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/config/producers/BuiltinProducersConfig.java#L132-L143 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.getForward | protected String getForward(HttpServletRequest req){
String forward = req.getParameter(PARAM_FORWARD);
if (forward==null)
forward = DEFAULT_FORWARD;
return forward;
} | java | protected String getForward(HttpServletRequest req){
String forward = req.getParameter(PARAM_FORWARD);
if (forward==null)
forward = DEFAULT_FORWARD;
return forward;
} | [
"protected",
"String",
"getForward",
"(",
"HttpServletRequest",
"req",
")",
"{",
"String",
"forward",
"=",
"req",
".",
"getParameter",
"(",
"PARAM_FORWARD",
")",
";",
"if",
"(",
"forward",
"==",
"null",
")",
"forward",
"=",
"DEFAULT_FORWARD",
";",
"return",
... | Returns the specified forward.
@param req
@return | [
"Returns",
"the",
"specified",
"forward",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L277-L282 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.getCurrentInterval | protected String getCurrentInterval(HttpServletRequest req, boolean saveToSession){
String intervalParameter = req.getParameter(PARAM_INTERVAL);
String interval = intervalParameter;
if (interval==null){
interval = (String)req.getSession().getAttribute(BEAN_INTERVAL);
if (interval == null)
interval = DEF... | java | protected String getCurrentInterval(HttpServletRequest req, boolean saveToSession){
String intervalParameter = req.getParameter(PARAM_INTERVAL);
String interval = intervalParameter;
if (interval==null){
interval = (String)req.getSession().getAttribute(BEAN_INTERVAL);
if (interval == null)
interval = DEF... | [
"protected",
"String",
"getCurrentInterval",
"(",
"HttpServletRequest",
"req",
",",
"boolean",
"saveToSession",
")",
"{",
"String",
"intervalParameter",
"=",
"req",
".",
"getParameter",
"(",
"PARAM_INTERVAL",
")",
";",
"String",
"interval",
"=",
"intervalParameter",
... | Returns the currently selected interval, either as parameter or from session.
@param req
@param saveToSession - if true the value from request will be stored to session.
@return | [
"Returns",
"the",
"currently",
"selected",
"interval",
"either",
"as",
"parameter",
"or",
"from",
"session",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L299-L310 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.getCurrentUnit | protected UnitBean getCurrentUnit(HttpServletRequest req, boolean saveToSession){
String unitParameter = req.getParameter(PARAM_UNIT);
if (unitParameter==null){
UnitBean ret = (UnitBean)req.getSession().getAttribute(BEAN_UNIT);
if (ret==null){
ret = DEFAULT_UNIT_BEAN;
//ensure a unit bean is always in... | java | protected UnitBean getCurrentUnit(HttpServletRequest req, boolean saveToSession){
String unitParameter = req.getParameter(PARAM_UNIT);
if (unitParameter==null){
UnitBean ret = (UnitBean)req.getSession().getAttribute(BEAN_UNIT);
if (ret==null){
ret = DEFAULT_UNIT_BEAN;
//ensure a unit bean is always in... | [
"protected",
"UnitBean",
"getCurrentUnit",
"(",
"HttpServletRequest",
"req",
",",
"boolean",
"saveToSession",
")",
"{",
"String",
"unitParameter",
"=",
"req",
".",
"getParameter",
"(",
"PARAM_UNIT",
")",
";",
"if",
"(",
"unitParameter",
"==",
"null",
")",
"{",
... | Returns the currently selected unit either from request or session.
@param req
@param saveToSession - if true the request parameter will be saved into session.
@return | [
"Returns",
"the",
"currently",
"selected",
"unit",
"either",
"from",
"request",
"or",
"session",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L327-L350 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.fetchRemoteConnectionFromUrl | private void fetchRemoteConnectionFromUrl(HttpServletRequest req){
String connection = req.getParameter("remoteConnection");
if(connection != null) try {
connection = URLDecoder.decode(connection, "UTF-8");
} catch (UnsupportedEncodingException e) {
return;
}
else
return;
String[] remoteHostAndP... | java | private void fetchRemoteConnectionFromUrl(HttpServletRequest req){
String connection = req.getParameter("remoteConnection");
if(connection != null) try {
connection = URLDecoder.decode(connection, "UTF-8");
} catch (UnsupportedEncodingException e) {
return;
}
else
return;
String[] remoteHostAndP... | [
"private",
"void",
"fetchRemoteConnectionFromUrl",
"(",
"HttpServletRequest",
"req",
")",
"{",
"String",
"connection",
"=",
"req",
".",
"getParameter",
"(",
"\"remoteConnection\"",
")",
";",
"if",
"(",
"connection",
"!=",
"null",
")",
"try",
"{",
"connection",
"... | Acquire remote connection url from request parameter.
If current user is not connected to application
from url - moskito will be connected to this application.
This made up for possibility to share links on moskito-inspect pages.
This method expects, that request will contain `remoteConnection` parameter
with value co... | [
"Acquire",
"remote",
"connection",
"url",
"from",
"request",
"parameter",
".",
"If",
"current",
"user",
"is",
"not",
"connected",
"to",
"application",
"from",
"url",
"-",
"moskito",
"will",
"be",
"connected",
"to",
"this",
"application",
".",
"This",
"made",
... | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L403-L445 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.rebuildQueryStringWithoutParameter | protected String rebuildQueryStringWithoutParameter(String source, String ... params){
if (source==null || source.length()==0)
return "";
if (params == null || params.length==0)
return source;
HashSet<String> paramsSet = new HashSet<String>(params.length);
paramsSet.addAll(Arrays.asList(params));
String... | java | protected String rebuildQueryStringWithoutParameter(String source, String ... params){
if (source==null || source.length()==0)
return "";
if (params == null || params.length==0)
return source;
HashSet<String> paramsSet = new HashSet<String>(params.length);
paramsSet.addAll(Arrays.asList(params));
String... | [
"protected",
"String",
"rebuildQueryStringWithoutParameter",
"(",
"String",
"source",
",",
"String",
"...",
"params",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"source",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"\"\"",
";",
"if",
"(",
... | Rebuilds query string from source.
@param source original source.
@param params parameters that should be included in the query string.
@return | [
"Rebuilds",
"query",
"string",
"from",
"source",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L635-L653 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.checkNavigationMenuState | private void checkNavigationMenuState(final HttpServletRequest req) {
if (req == null)
return;
if (req.getSession().getAttribute(ATTR_IS_NAV_MENU_COLLAPSED) != null)
return;
// here we can specify default collapse value
req.getSession().setAttribute(ATTR_IS_NAV_MENU_COLLAPSED, false);
} | java | private void checkNavigationMenuState(final HttpServletRequest req) {
if (req == null)
return;
if (req.getSession().getAttribute(ATTR_IS_NAV_MENU_COLLAPSED) != null)
return;
// here we can specify default collapse value
req.getSession().setAttribute(ATTR_IS_NAV_MENU_COLLAPSED, false);
} | [
"private",
"void",
"checkNavigationMenuState",
"(",
"final",
"HttpServletRequest",
"req",
")",
"{",
"if",
"(",
"req",
"==",
"null",
")",
"return",
";",
"if",
"(",
"req",
".",
"getSession",
"(",
")",
".",
"getAttribute",
"(",
"ATTR_IS_NAV_MENU_COLLAPSED",
")",
... | Check, if navigation menu default state present in request. If there is no state, set default value.
@param req
{@link HttpServletRequest} | [
"Check",
"if",
"navigation",
"menu",
"default",
"state",
"present",
"in",
"request",
".",
"If",
"there",
"is",
"no",
"state",
"set",
"default",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L661-L670 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.setInfoMessage | protected void setInfoMessage(String message) {
try {
APICallContext.getCallContext().getCurrentSession().setAttribute("infoMessage", APISession.POLICY_FLASH, message);
}catch(NullPointerException e){
log.error("Can't set info message (flash) due", e);
log.error("APICallContext: "+APICallContext.getCallCon... | java | protected void setInfoMessage(String message) {
try {
APICallContext.getCallContext().getCurrentSession().setAttribute("infoMessage", APISession.POLICY_FLASH, message);
}catch(NullPointerException e){
log.error("Can't set info message (flash) due", e);
log.error("APICallContext: "+APICallContext.getCallCon... | [
"protected",
"void",
"setInfoMessage",
"(",
"String",
"message",
")",
"{",
"try",
"{",
"APICallContext",
".",
"getCallContext",
"(",
")",
".",
"getCurrentSession",
"(",
")",
".",
"setAttribute",
"(",
"\"infoMessage\"",
",",
"APISession",
".",
"POLICY_FLASH",
","... | Sets an info message that can be shown on next screen. The info message is readable exactly once.
@param message the info message. | [
"Sets",
"an",
"info",
"message",
"that",
"can",
"be",
"shown",
"on",
"next",
"screen",
".",
"The",
"info",
"message",
"is",
"readable",
"exactly",
"once",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L726-L736 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java | BaseMoskitoUIAction.getInfoMessage | protected String getInfoMessage() {
try {
return (String) APICallContext.getCallContext().getCurrentSession().getAttribute("infoMessage");
}catch(Exception any){
return null;
}
} | java | protected String getInfoMessage() {
try {
return (String) APICallContext.getCallContext().getCurrentSession().getAttribute("infoMessage");
}catch(Exception any){
return null;
}
} | [
"protected",
"String",
"getInfoMessage",
"(",
")",
"{",
"try",
"{",
"return",
"(",
"String",
")",
"APICallContext",
".",
"getCallContext",
"(",
")",
".",
"getCurrentSession",
"(",
")",
".",
"getAttribute",
"(",
"\"infoMessage\"",
")",
";",
"}",
"catch",
"(",... | Returns a previously set info message or null if no message has been set.
@return | [
"Returns",
"a",
"previously",
"set",
"info",
"message",
"or",
"null",
"if",
"no",
"message",
"has",
"been",
"set",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseMoskitoUIAction.java#L742-L748 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/OnProducerDataReceivedListenerImpl.java | OnProducerDataReceivedListenerImpl.updateProducer | public synchronized void updateProducer(PHPProducerDTO producerDTO) {
Mapper mapper = mappersRegistry.getMapper(producerDTO.getMapperId());
if (mapper == null) {
log.error("Mapper with id " + producerDTO.getMapperId() + " is not found to map producer "
+ producerDTO.get... | java | public synchronized void updateProducer(PHPProducerDTO producerDTO) {
Mapper mapper = mappersRegistry.getMapper(producerDTO.getMapperId());
if (mapper == null) {
log.error("Mapper with id " + producerDTO.getMapperId() + " is not found to map producer "
+ producerDTO.get... | [
"public",
"synchronized",
"void",
"updateProducer",
"(",
"PHPProducerDTO",
"producerDTO",
")",
"{",
"Mapper",
"mapper",
"=",
"mappersRegistry",
".",
"getMapper",
"(",
"producerDTO",
".",
"getMapperId",
"(",
")",
")",
";",
"if",
"(",
"mapper",
"==",
"null",
")"... | Processes incoming producer data.
@param producerDTO incoming producer data to be submitted | [
"Processes",
"incoming",
"producer",
"data",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/OnProducerDataReceivedListenerImpl.java#L45-L63 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.init | @Override public void init(ServletConfig config) throws ServletException{
super.init(config);
getStats = new ServletStats("get", getMonitoringIntervals());
postStats = new ServletStats("post", getMonitoringIntervals());
putStats = new ServletStats("put", getMonitoringIntervals());
... | java | @Override public void init(ServletConfig config) throws ServletException{
super.init(config);
getStats = new ServletStats("get", getMonitoringIntervals());
postStats = new ServletStats("post", getMonitoringIntervals());
putStats = new ServletStats("put", getMonitoringIntervals());
... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"ServletConfig",
"config",
")",
"throws",
"ServletException",
"{",
"super",
".",
"init",
"(",
"config",
")",
";",
"getStats",
"=",
"new",
"ServletStats",
"(",
"\"get\"",
",",
"getMonitoringIntervals",
"(",
")",
... | Creates the stats objects. Registers the servlet at the ProducerRegistry. | [
"Creates",
"the",
"stats",
"objects",
".",
"Registers",
"the",
"servlet",
"at",
"the",
"ProducerRegistry",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L108-L133 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoDelete | protected void moskitoDoDelete(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doDelete(req, res);
} | java | protected void moskitoDoDelete(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doDelete(req, res);
} | [
"protected",
"void",
"moskitoDoDelete",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doDelete",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http delete method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"delete",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L347-L349 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoGet | protected void moskitoDoGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doGet(req, res);
} | java | protected void moskitoDoGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doGet(req, res);
} | [
"protected",
"void",
"moskitoDoGet",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doGet",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http get method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"get",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L354-L356 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoHead | protected void moskitoDoHead(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doHead(req, res);
} | java | protected void moskitoDoHead(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doHead(req, res);
} | [
"protected",
"void",
"moskitoDoHead",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doHead",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http head method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"head",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L361-L363 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoOptions | protected void moskitoDoOptions(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doOptions(req, res);
} | java | protected void moskitoDoOptions(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doOptions(req, res);
} | [
"protected",
"void",
"moskitoDoOptions",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doOptions",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http options method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"options",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L368-L370 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoPost | protected void moskitoDoPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doPost(req, res);
} | java | protected void moskitoDoPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doPost(req, res);
} | [
"protected",
"void",
"moskitoDoPost",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doPost",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http post method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"post",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L375-L377 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoPut | protected void moskitoDoPut(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doPut(req, res);
} | java | protected void moskitoDoPut(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doPut(req, res);
} | [
"protected",
"void",
"moskitoDoPut",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doPut",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http put method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"put",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L382-L384 | train |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java | MoskitoHttpServlet.moskitoDoTrace | protected void moskitoDoTrace(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doTrace(req, res);
} | java | protected void moskitoDoTrace(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doTrace(req, res);
} | [
"protected",
"void",
"moskitoDoTrace",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doTrace",
"(",
"req",
",",
"res",
")",
";",
"}"
] | Override this method to react on http trace method. | [
"Override",
"this",
"method",
"to",
"react",
"on",
"http",
"trace",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/MoskitoHttpServlet.java#L389-L391 | train |
anotheria/moskito | moskito-integration/moskito-ehcache/src/main/java/net/anotheria/moskito/integration/ehcache/MonitoredEhcache.java | MonitoredEhcache.updateStats | private void updateStats() {
EhcacheStats stats = getProducerStats();
Statistics statistics = underlyingCache.getStatistics();
double accesses = statistics.getCacheHits() + statistics.getCacheMisses();
double hitRatio = accesses != 0 ? statistics.getCacheHits() / accesses : 0;
s... | java | private void updateStats() {
EhcacheStats stats = getProducerStats();
Statistics statistics = underlyingCache.getStatistics();
double accesses = statistics.getCacheHits() + statistics.getCacheMisses();
double hitRatio = accesses != 0 ? statistics.getCacheHits() / accesses : 0;
s... | [
"private",
"void",
"updateStats",
"(",
")",
"{",
"EhcacheStats",
"stats",
"=",
"getProducerStats",
"(",
")",
";",
"Statistics",
"statistics",
"=",
"underlyingCache",
".",
"getStatistics",
"(",
")",
";",
"double",
"accesses",
"=",
"statistics",
".",
"getCacheHits... | Updates internal producer's stats using Ehcache statistics. | [
"Updates",
"internal",
"producer",
"s",
"stats",
"using",
"Ehcache",
"statistics",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-ehcache/src/main/java/net/anotheria/moskito/integration/ehcache/MonitoredEhcache.java#L116-L146 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowProducerAction.java | ShowProducerAction.populateStats | private void populateStats(final StatDecoratorBean statDecoratorBean, final List<StatLineAO> allStatLines, final StatBeanSortType sortType) {
if (allStatLines == null || allStatLines.isEmpty()) {
LOGGER.warn("Producer's stats are empty");
return;
}
final int cumulatedIndex = getCumulatedIndex(allStatLines)... | java | private void populateStats(final StatDecoratorBean statDecoratorBean, final List<StatLineAO> allStatLines, final StatBeanSortType sortType) {
if (allStatLines == null || allStatLines.isEmpty()) {
LOGGER.warn("Producer's stats are empty");
return;
}
final int cumulatedIndex = getCumulatedIndex(allStatLines)... | [
"private",
"void",
"populateStats",
"(",
"final",
"StatDecoratorBean",
"statDecoratorBean",
",",
"final",
"List",
"<",
"StatLineAO",
">",
"allStatLines",
",",
"final",
"StatBeanSortType",
"sortType",
")",
"{",
"if",
"(",
"allStatLines",
"==",
"null",
"||",
"allSta... | Allows to set all stats to decorator except cumulated stat.
Stats will be sorted using given sort type.
@param statDecoratorBean {@link StatDecoratorBean}
@param allStatLines list of {@link StatLineAO}, all stats present in producer
@param sortType {@link StatBeanSortType} | [
"Allows",
"to",
"set",
"all",
"stats",
"to",
"decorator",
"except",
"cumulated",
"stat",
".",
"Stats",
"will",
"be",
"sorted",
"using",
"given",
"sort",
"type",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowProducerAction.java#L194-L223 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowProducerAction.java | ShowProducerAction.populateGraphData | private void populateGraphData(final IDecorator decorator, final Map<String, GraphDataBean> graphData, final List<StatLineAO> allStatLines) {
final int cumulatedIndex = getCumulatedIndex(allStatLines);
for (int i = 0; i < allStatLines.size(); i++) {
if (i == cumulatedIndex)
continue;
//TODO fix filterze... | java | private void populateGraphData(final IDecorator decorator, final Map<String, GraphDataBean> graphData, final List<StatLineAO> allStatLines) {
final int cumulatedIndex = getCumulatedIndex(allStatLines);
for (int i = 0; i < allStatLines.size(); i++) {
if (i == cumulatedIndex)
continue;
//TODO fix filterze... | [
"private",
"void",
"populateGraphData",
"(",
"final",
"IDecorator",
"decorator",
",",
"final",
"Map",
"<",
"String",
",",
"GraphDataBean",
">",
"graphData",
",",
"final",
"List",
"<",
"StatLineAO",
">",
"allStatLines",
")",
"{",
"final",
"int",
"cumulatedIndex",... | Allows to populate graph data.
@param decorator {@link IDecorator}
@param graphData map with graph data
@param allStatLines list of {@link StatLineAO}, all stats present in producer | [
"Allows",
"to",
"populate",
"graph",
"data",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowProducerAction.java#L257-L279 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowProducerAction.java | ShowProducerAction.getCumulatedIndex | private int getCumulatedIndex(final List<StatLineAO> allStatLines) {
if (allStatLines == null || allStatLines.isEmpty()) {
return -1;
}
int cumulatedIndex = -1;
for (int i = 0, allStatLinesSize = allStatLines.size(); i < allStatLinesSize; i++) {
final StatLineAO statLine = allStatLines.get(i);
if (C... | java | private int getCumulatedIndex(final List<StatLineAO> allStatLines) {
if (allStatLines == null || allStatLines.isEmpty()) {
return -1;
}
int cumulatedIndex = -1;
for (int i = 0, allStatLinesSize = allStatLines.size(); i < allStatLinesSize; i++) {
final StatLineAO statLine = allStatLines.get(i);
if (C... | [
"private",
"int",
"getCumulatedIndex",
"(",
"final",
"List",
"<",
"StatLineAO",
">",
"allStatLines",
")",
"{",
"if",
"(",
"allStatLines",
"==",
"null",
"||",
"allStatLines",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"cumula... | Returns index of cumulated stat in producer's stats.
@param allStatLines list of {@link StatLineAO}
@return index of cumulated stat or {@value -1} if was not found | [
"Returns",
"index",
"of",
"cumulated",
"stat",
"in",
"producer",
"s",
"stats",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowProducerAction.java#L287-L304 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.getDefaultStats | protected final T getDefaultStats(OnDemandStatsProducer producer) {
try {
return getStatsClass().cast(producer.getDefaultStats());
} catch (ClassCastException e) {
LOGGER.error("getDefaultStats(): Unexpected stats type", e);
return null;
}
} | java | protected final T getDefaultStats(OnDemandStatsProducer producer) {
try {
return getStatsClass().cast(producer.getDefaultStats());
} catch (ClassCastException e) {
LOGGER.error("getDefaultStats(): Unexpected stats type", e);
return null;
}
} | [
"protected",
"final",
"T",
"getDefaultStats",
"(",
"OnDemandStatsProducer",
"producer",
")",
"{",
"try",
"{",
"return",
"getStatsClass",
"(",
")",
".",
"cast",
"(",
"producer",
".",
"getDefaultStats",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ClassCastException"... | Returns default stats for producer.
@param producer {@link OnDemandStatsProducer}
@return default stats for producer | [
"Returns",
"default",
"stats",
"for",
"producer",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L88-L95 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.getStats | protected final T getStats(OnDemandStatsProducer producer, String name) {
try {
return getStatsClass().cast(producer.getStats(name));
} catch (ClassCastException e) {
LOGGER.error("getStats(): Unexpected stats type", e);
} catch (OnDemandStatsProducerException e) {
... | java | protected final T getStats(OnDemandStatsProducer producer, String name) {
try {
return getStatsClass().cast(producer.getStats(name));
} catch (ClassCastException e) {
LOGGER.error("getStats(): Unexpected stats type", e);
} catch (OnDemandStatsProducerException e) {
... | [
"protected",
"final",
"T",
"getStats",
"(",
"OnDemandStatsProducer",
"producer",
",",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"getStatsClass",
"(",
")",
".",
"cast",
"(",
"producer",
".",
"getStats",
"(",
"name",
")",
")",
";",
"}",
"catch",
"(... | Returns stats for producer.
@param producer {@link OnDemandStatsProducer}
@param name stats name
@return stats for producer | [
"Returns",
"stats",
"for",
"producer",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L104-L114 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.proceed | protected static Object proceed(InvocationContext ctx) throws Throwable {
try {
return ctx.proceed();
} catch (InvocationTargetException e) {
throw e.getCause();
}
} | java | protected static Object proceed(InvocationContext ctx) throws Throwable {
try {
return ctx.proceed();
} catch (InvocationTargetException e) {
throw e.getCause();
}
} | [
"protected",
"static",
"Object",
"proceed",
"(",
"InvocationContext",
"ctx",
")",
"throws",
"Throwable",
"{",
"try",
"{",
"return",
"ctx",
".",
"proceed",
"(",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"e",
")",
"{",
"throw",
"e",
".",
"get... | Proceed further.
@param ctx {@link InvocationContext}
@return method return value
@throws Throwable if intercepted method throws exception | [
"Proceed",
"further",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L136-L142 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.createAccumulator | private void createAccumulator(String producerId, Accumulate annotation, String accName, String statsName) {
if (annotation != null && producerId != null && !producerId.isEmpty() &&
accName!=null && !accName.isEmpty() && statsName != null && !statsName.isEmpty()){
AccumulatorDefinit... | java | private void createAccumulator(String producerId, Accumulate annotation, String accName, String statsName) {
if (annotation != null && producerId != null && !producerId.isEmpty() &&
accName!=null && !accName.isEmpty() && statsName != null && !statsName.isEmpty()){
AccumulatorDefinit... | [
"private",
"void",
"createAccumulator",
"(",
"String",
"producerId",
",",
"Accumulate",
"annotation",
",",
"String",
"accName",
",",
"String",
"statsName",
")",
"{",
"if",
"(",
"annotation",
"!=",
"null",
"&&",
"producerId",
"!=",
"null",
"&&",
"!",
"producerI... | Create accumulator and register it.
@param producerId id of the producer
@param annotation Accumulate annotation
@param accName Accumulator name
@param statsName Statistics name | [
"Create",
"accumulator",
"and",
"register",
"it",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L226-L243 | train |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.getMethodName | private String getMethodName(Method method) {
StatName statNameAnnotation = method.getAnnotation(StatName.class);
return statNameAnnotation != null ? statNameAnnotation.value() : method.getName();
} | java | private String getMethodName(Method method) {
StatName statNameAnnotation = method.getAnnotation(StatName.class);
return statNameAnnotation != null ? statNameAnnotation.value() : method.getName();
} | [
"private",
"String",
"getMethodName",
"(",
"Method",
"method",
")",
"{",
"StatName",
"statNameAnnotation",
"=",
"method",
".",
"getAnnotation",
"(",
"StatName",
".",
"class",
")",
";",
"return",
"statNameAnnotation",
"!=",
"null",
"?",
"statNameAnnotation",
".",
... | Returns name of the given method.
@param method {@link Method}
@return the method name or custom name provided via {@link StatName} annotation | [
"Returns",
"name",
"of",
"the",
"given",
"method",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L251-L254 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/api/AnalyzedProducerCallsMapAO.java | AnalyzedProducerCallsMapAO.addProducerCall | public void addProducerCall(String producerId, long duration){
AnalyzedProducerCallsAO bean = beans.get(producerId);
if (bean==null){
bean = new AnalyzedProducerCallsAO(producerId);
beans.put(producerId, bean);
}
bean.addCall(duration);
totalCalls++;
totalDuration+=duration;
} | java | public void addProducerCall(String producerId, long duration){
AnalyzedProducerCallsAO bean = beans.get(producerId);
if (bean==null){
bean = new AnalyzedProducerCallsAO(producerId);
beans.put(producerId, bean);
}
bean.addCall(duration);
totalCalls++;
totalDuration+=duration;
} | [
"public",
"void",
"addProducerCall",
"(",
"String",
"producerId",
",",
"long",
"duration",
")",
"{",
"AnalyzedProducerCallsAO",
"bean",
"=",
"beans",
".",
"get",
"(",
"producerId",
")",
";",
"if",
"(",
"bean",
"==",
"null",
")",
"{",
"bean",
"=",
"new",
... | Adds a new producer call. The duration and the number of calls for each producer will be increased accordingly.
@param producerId id of the producer.
@param duration duration of the call. | [
"Adds",
"a",
"new",
"producer",
"call",
".",
"The",
"duration",
"and",
"the",
"number",
"of",
"calls",
"for",
"each",
"producer",
"will",
"be",
"increased",
"accordingly",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/api/AnalyzedProducerCallsMapAO.java#L52-L62 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/IOUtils.java | IOUtils.getInputStreamAsString | public static String getInputStreamAsString(InputStream is) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ReadableByteChannel rbch = Channels.newChannel(is);
WritableByteChannel wbch = Channels.newChannel(baos);
fastChannelCopy(rbch, wbch);
rbch.close();
wbch.close();
retu... | java | public static String getInputStreamAsString(InputStream is) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ReadableByteChannel rbch = Channels.newChannel(is);
WritableByteChannel wbch = Channels.newChannel(baos);
fastChannelCopy(rbch, wbch);
rbch.close();
wbch.close();
retu... | [
"public",
"static",
"String",
"getInputStreamAsString",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ReadableByteChannel",
"rbch",
"=",
"Channels",
".",
"newChannel",... | converts input stream to string value
@param is
@return
@throws IOException | [
"converts",
"input",
"stream",
"to",
"string",
"value"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/IOUtils.java#L30-L38 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java | ProducerRegistryAPIImpl.rebuildProducerCache | private void rebuildProducerCache(Collection<IStatsProducer> producers){
log.debug("Rebuilding producer cache with "+producers.size()+" producers.");
log.debug("Following producers known: "+producers);
synchronized(cacheLock){
//lets create lists with more place to store as actually need, we will probab... | java | private void rebuildProducerCache(Collection<IStatsProducer> producers){
log.debug("Rebuilding producer cache with "+producers.size()+" producers.");
log.debug("Following producers known: "+producers);
synchronized(cacheLock){
//lets create lists with more place to store as actually need, we will probab... | [
"private",
"void",
"rebuildProducerCache",
"(",
"Collection",
"<",
"IStatsProducer",
">",
"producers",
")",
"{",
"log",
".",
"debug",
"(",
"\"Rebuilding producer cache with \"",
"+",
"producers",
".",
"size",
"(",
")",
"+",
"\" producers.\"",
")",
";",
"log",
".... | Rebuilds the caches with given producers.. | [
"Rebuilds",
"the",
"caches",
"with",
"given",
"producers",
".."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java#L129-L154 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java | ProducerRegistryAPIImpl.getAllProducers | @Override public List<IStatsProducer> getAllProducers() {
if (_cachedProducerList==null)
buildProducerCacheFromScratch();
List<IStatsProducer> ret = new ArrayList<>();
for (ProducerReference pr : _cachedProducerList){
if (pr.get()!=null)
ret.add(pr.get());
}
return ret;
} | java | @Override public List<IStatsProducer> getAllProducers() {
if (_cachedProducerList==null)
buildProducerCacheFromScratch();
List<IStatsProducer> ret = new ArrayList<>();
for (ProducerReference pr : _cachedProducerList){
if (pr.get()!=null)
ret.add(pr.get());
}
return ret;
} | [
"@",
"Override",
"public",
"List",
"<",
"IStatsProducer",
">",
"getAllProducers",
"(",
")",
"{",
"if",
"(",
"_cachedProducerList",
"==",
"null",
")",
"buildProducerCacheFromScratch",
"(",
")",
";",
"List",
"<",
"IStatsProducer",
">",
"ret",
"=",
"new",
"ArrayL... | producer during processing. | [
"producer",
"during",
"processing",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java#L158-L168 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java | ProducerRegistryAPIImpl.createIntervalList | private void createIntervalList(){
synchronized(intervalLock){
if (_cachedIntervalInfos!=null)
return;
List<Interval> intervals = intervalRegistry.getIntervals();
_cachedIntervalInfos = new ArrayList<IntervalInfo>(intervals.size());
for (Interval interval : intervals) {
_cachedIntervalInfos.add(ne... | java | private void createIntervalList(){
synchronized(intervalLock){
if (_cachedIntervalInfos!=null)
return;
List<Interval> intervals = intervalRegistry.getIntervals();
_cachedIntervalInfos = new ArrayList<IntervalInfo>(intervals.size());
for (Interval interval : intervals) {
_cachedIntervalInfos.add(ne... | [
"private",
"void",
"createIntervalList",
"(",
")",
"{",
"synchronized",
"(",
"intervalLock",
")",
"{",
"if",
"(",
"_cachedIntervalInfos",
"!=",
"null",
")",
"return",
";",
"List",
"<",
"Interval",
">",
"intervals",
"=",
"intervalRegistry",
".",
"getIntervals",
... | Creates the list of existing intervals. | [
"Creates",
"the",
"list",
"of",
"existing",
"intervals",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java#L187-L198 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.