mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Format EppMetrics a bit nicer
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125061643
This commit is contained in:
parent
3e0963dfdb
commit
3be61a13b5
2 changed files with 6 additions and 8 deletions
|
@ -43,7 +43,6 @@ java_library(
|
||||||
"//java/google/registry/monitoring/whitebox",
|
"//java/google/registry/monitoring/whitebox",
|
||||||
"//java/google/registry/pricing",
|
"//java/google/registry/pricing",
|
||||||
"//java/google/registry/request",
|
"//java/google/registry/request",
|
||||||
"//java/google/registry/security:servlets",
|
|
||||||
"//java/google/registry/tldconfig/idn",
|
"//java/google/registry/tldconfig/idn",
|
||||||
"//java/google/registry/tmch",
|
"//java/google/registry/tmch",
|
||||||
"//java/google/registry/util",
|
"//java/google/registry/util",
|
||||||
|
|
|
@ -14,8 +14,9 @@
|
||||||
|
|
||||||
package google.registry.monitoring.whitebox;
|
package google.registry.monitoring.whitebox;
|
||||||
|
|
||||||
|
import static com.google.apphosting.api.ApiProxy.getCurrentEnvironment;
|
||||||
|
|
||||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||||
import com.google.apphosting.api.ApiProxy;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import google.registry.bigquery.BigqueryUtils.FieldType;
|
import google.registry.bigquery.BigqueryUtils.FieldType;
|
||||||
|
@ -28,6 +29,8 @@ import javax.inject.Inject;
|
||||||
@RequestScope
|
@RequestScope
|
||||||
public class EppMetrics extends Metrics {
|
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 String EPPMETRICS_TABLE_ID = "eppMetrics";
|
||||||
|
|
||||||
static final ImmutableList<TableFieldSchema> EPPMETRICS_SCHEMA_FIELDS =
|
static final ImmutableList<TableFieldSchema> EPPMETRICS_SCHEMA_FIELDS =
|
||||||
|
@ -46,10 +49,7 @@ public class EppMetrics extends Metrics {
|
||||||
public EppMetrics() {
|
public EppMetrics() {
|
||||||
setTableId(EPPMETRICS_TABLE_ID);
|
setTableId(EPPMETRICS_TABLE_ID);
|
||||||
fields.put("attempts", 0);
|
fields.put("attempts", 0);
|
||||||
fields.put(
|
fields.put("requestId", getCurrentEnvironment().getAttributes().get(REQUEST_LOG_ID).toString());
|
||||||
"requestId",
|
|
||||||
ApiProxy.getCurrentEnvironment().getAttributes()
|
|
||||||
.get("com.google.appengine.runtime.request_log_id").toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCommandName(String name) {
|
public void setCommandName(String name) {
|
||||||
|
@ -73,7 +73,6 @@ public class EppMetrics extends Metrics {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementAttempts() {
|
public void incrementAttempts() {
|
||||||
int attempts = (int) fields.get("attempts");
|
fields.put("attempts", ((int) fields.get("attempts")) + 1);
|
||||||
fields.put("attempts", attempts + 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue