mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37:13 +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
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue