|
14 | 14 |
|
15 | 15 | package com.google.firebase.perf.metrics;
|
16 | 16 |
|
| 17 | +import static com.google.firebase.perf.metrics.validator.PerfMetricValidator.*; |
| 18 | + |
17 | 19 | import android.os.Parcel;
|
18 | 20 | import android.os.Parcelable;
|
19 | 21 | import androidx.annotation.Keep;
|
@@ -209,7 +211,7 @@ public void start() {
|
209 | 211 | return;
|
210 | 212 | }
|
211 | 213 |
|
212 |
| - String err = PerfMetricValidator.validateTraceName(name); |
| 214 | + String err = validateTraceName(name); |
213 | 215 |
|
214 | 216 | if (err != null) {
|
215 | 217 | logger.error("Cannot start trace '%s'. Trace name is invalid.(%s)", name, err);
|
@@ -326,7 +328,7 @@ private Counter obtainOrCreateCounterByName(@NonNull String counterName) {
|
326 | 328 | */
|
327 | 329 | @Keep
|
328 | 330 | public void incrementMetric(@NonNull String metricName, long incrementBy) {
|
329 |
| - String err = PerfMetricValidator.validateMetricName(metricName); |
| 331 | + String err = validateMetricName(metricName); |
330 | 332 | if (err != null) {
|
331 | 333 | logger.error("Cannot increment metric '%s'. Metric name is invalid.(%s)", metricName, err);
|
332 | 334 | return;
|
@@ -382,7 +384,7 @@ public long getLongMetric(@NonNull String metricName) {
|
382 | 384 | */
|
383 | 385 | @Keep
|
384 | 386 | public void putMetric(@NonNull String metricName, long value) {
|
385 |
| - String err = PerfMetricValidator.validateMetricName(metricName); |
| 387 | + String err = validateMetricName(metricName); |
386 | 388 | if (err != null) {
|
387 | 389 | logger.error(
|
388 | 390 | "Cannot set value for metric '%s'. Metric name is invalid.(%s)", metricName, err);
|
@@ -639,7 +641,7 @@ private void checkAttribute(@NonNull String key, @NonNull String value) {
|
639 | 641 | "Exceeds max limit of number of attributes - %d",
|
640 | 642 | Constants.MAX_TRACE_CUSTOM_ATTRIBUTES));
|
641 | 643 | }
|
642 |
| - PerfMetricValidator.validateAttribute(new AbstractMap.SimpleEntry<>(key, value)); |
| 644 | + validateAttribute(new AbstractMap.SimpleEntry<>(key, value)); |
643 | 645 | }
|
644 | 646 |
|
645 | 647 | /**
|
|
0 commit comments