Skip to content

Commit c71dd98

Browse files
authored
GEOMESA-3499 Consolidate converter metric tags (#3433)
1 parent b69d0ce commit c71dd98

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

geomesa-convert/geomesa-convert-common/src/main/scala/org/locationtech/geomesa/convert2/validators/CqlValidatorFactory.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object CqlValidatorFactory {
4141
private val attributes = FilterHelper.propertyNames(filter).sorted.mkString(",")
4242

4343
private val success = successCounter("cql", attributes, tags)
44-
private val failure = failureCounter("cql", attributes, "filter", tags)
44+
private val failure = failureCounter("cql", attributes, "filtered", tags)
4545
private val error = s"failed filter: $ecql"
4646

4747
override def validate(sf: SimpleFeature): String = {

geomesa-convert/geomesa-convert-common/src/main/scala/org/locationtech/geomesa/convert2/validators/package.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@ package object validators {
2323
* @return
2424
*/
2525
def successCounter(validator: String, attribute: String, tags: Tags): Counter =
26-
Metrics.counter(ConverterMetrics.name("validate"), tags.and(this.tags(validator, attribute, "pass", "")))
26+
Metrics.counter(ConverterMetrics.name("validate"), tags.and(this.tags(validator, attribute, "pass")))
2727

2828
/**
2929
* Create a counter for failed validations
3030
*
3131
* @param validator validator name
3232
* @param attribute attribute name
33-
* @param reason reason tag
33+
* @param result result tag
3434
* @param tags common tags
3535
* @return
3636
*/
37-
def failureCounter(validator: String, attribute: String, reason: String, tags: Tags): Counter =
38-
Metrics.counter(ConverterMetrics.name("validate"), tags.and(this.tags(validator, attribute, "fail", reason)))
37+
def failureCounter(validator: String, attribute: String, result: String, tags: Tags): Counter =
38+
Metrics.counter(ConverterMetrics.name("validate"), tags.and(this.tags(validator, attribute, result)))
3939

4040
/**
4141
* Standardized tags
4242
*/
43-
private def tags(validator: String, attribute: String, result: String, reason: String): Tags =
44-
Tags.of("validator", validator, "attribute", attribute, "result", result, "reason", reason)
43+
private def tags(validator: String, attribute: String, result: String): Tags =
44+
Tags.of("validator", validator, "attribute", attribute, "result", result)
4545

4646
/**
4747
* Holder for an attribute name + index

geomesa-convert/geomesa-convert-json/src/test/scala/org/locationtech/geomesa/convert/json/JsonConverterTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,8 @@ class JsonConverterTest extends Specification {
14781478
}
14791479
val countPass = getCounter("geomesa.converter.count", Tags.of("result", "success")).orNull
14801480
val countFail = getCounter("geomesa.converter.count", Tags.of("result", "failure")).orNull
1481-
val validateNullGeom = getCounter("geomesa.converter.validate", Tags.of("result", "fail", "attribute", "geom", "reason", "null")).orNull
1482-
val validateBoundsGeom = getCounter("geomesa.converter.validate", Tags.of("result", "fail", "attribute", "geom", "reason", "invalid.bounds")).orNull
1481+
val validateNullGeom = getCounter("geomesa.converter.validate", Tags.of("result", "null", "attribute", "geom")).orNull
1482+
val validateBoundsGeom = getCounter("geomesa.converter.validate", Tags.of("result", "invalid.bounds", "attribute", "geom")).orNull
14831483

14841484
countPass must not(beNull)
14851485
countFail must not(beNull)

0 commit comments

Comments
 (0)