mirror of
https://github.com/google/nomulus
synced 2026-01-04 04:04:22 +00:00
Format EppMetrics a bit nicer
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125061643
This commit is contained in:
@@ -43,7 +43,6 @@ java_library(
|
||||
"//java/google/registry/monitoring/whitebox",
|
||||
"//java/google/registry/pricing",
|
||||
"//java/google/registry/request",
|
||||
"//java/google/registry/security:servlets",
|
||||
"//java/google/registry/tldconfig/idn",
|
||||
"//java/google/registry/tmch",
|
||||
"//java/google/registry/util",
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
|
||||
package google.registry.monitoring.whitebox;
|
||||
|
||||
import static com.google.apphosting.api.ApiProxy.getCurrentEnvironment;
|
||||
|
||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||
import com.google.apphosting.api.ApiProxy;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import google.registry.bigquery.BigqueryUtils.FieldType;
|
||||
@@ -28,6 +29,8 @@ import javax.inject.Inject;
|
||||
@RequestScope
|
||||
public class EppMetrics extends Metrics {
|
||||
|
||||
private static final String REQUEST_LOG_ID = "com.google.appengine.runtime.request_log_id";
|
||||
|
||||
static final String EPPMETRICS_TABLE_ID = "eppMetrics";
|
||||
|
||||
static final ImmutableList<TableFieldSchema> EPPMETRICS_SCHEMA_FIELDS =
|
||||
@@ -46,10 +49,7 @@ public class EppMetrics extends Metrics {
|
||||
public EppMetrics() {
|
||||
setTableId(EPPMETRICS_TABLE_ID);
|
||||
fields.put("attempts", 0);
|
||||
fields.put(
|
||||
"requestId",
|
||||
ApiProxy.getCurrentEnvironment().getAttributes()
|
||||
.get("com.google.appengine.runtime.request_log_id").toString());
|
||||
fields.put("requestId", getCurrentEnvironment().getAttributes().get(REQUEST_LOG_ID).toString());
|
||||
}
|
||||
|
||||
public void setCommandName(String name) {
|
||||
@@ -73,7 +73,6 @@ public class EppMetrics extends Metrics {
|
||||
}
|
||||
|
||||
public void incrementAttempts() {
|
||||
int attempts = (int) fields.get("attempts");
|
||||
fields.put("attempts", attempts + 1);
|
||||
fields.put("attempts", ((int) fields.get("attempts")) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user