Compare commits
No commits in common. "bc1feb0bc16e8aa90d016818404698d08e839124" and "ea3fff30b8ee9b3ca04cc5694cf8e407022c79f9" have entirely different histories.
bc1feb0bc1
...
ea3fff30b8
|
@ -99,18 +99,6 @@ const metricObj = {
|
|||
users: 'userId',
|
||||
};
|
||||
|
||||
const converters = {
|
||||
_genericPushMetric: '_convertParamsGenericPushMetric',
|
||||
_pushMetricDeleteMarkerObject: '_convertParamsGenericPushMetric',
|
||||
_pushMetricListBucketMultipartUploads: '_convertParamsGenericPushMetric',
|
||||
_pushMetricDeleteBucket: '_convertParamsGenericPushMetric',
|
||||
_pushMetricGetObject: '_convertParamsPushMetricGetObject',
|
||||
_genericPushMetricPutObject: '_convertGenericPushMetricPutObject',
|
||||
_genericPushMetricDeleteObject: '_convertGenericPushMetricDeleteObject',
|
||||
_pushMetricCompleteMultipartUpload: '_convertPushMetricCompleteMultipartUpload',
|
||||
_genericPushMetricUploadPart: '_convertGenericPushMetricUploadPart',
|
||||
};
|
||||
|
||||
class UtapiClient {
|
||||
/**
|
||||
* Create a UtapiClient
|
||||
|
@ -432,11 +420,6 @@ class UtapiClient {
|
|||
return callback();
|
||||
}
|
||||
|
||||
pushMetricV2(metric, reqUid, params, cb) {
|
||||
const convertedParams = this[converters[methods[metric].method]](params);
|
||||
return this.pushMetric(metric, reqUid, convertedParams, cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates counter for the given action
|
||||
* @param {object} params - params for the metrics
|
||||
|
@ -1156,51 +1139,6 @@ class UtapiClient {
|
|||
return callback(null, res);
|
||||
});
|
||||
}
|
||||
|
||||
_convertParamsGenericPushMetric(params) {
|
||||
return params;
|
||||
}
|
||||
|
||||
_convertParamsPushMetricGetObject(params) {
|
||||
return {
|
||||
// newByteLength used as value for outgoingBytes
|
||||
newByteLength: params.outgoingBytes,
|
||||
...params,
|
||||
};
|
||||
}
|
||||
|
||||
_convertGenericPushMetricPutObject(params) {
|
||||
return {
|
||||
newByteLength: params.incomingBytes,
|
||||
oldByteLength: !params.objectDelta ? params.incomingBytes - params.sizeDelta : null,
|
||||
...params,
|
||||
};
|
||||
}
|
||||
|
||||
_convertGenericPushMetricDeleteObject(params) {
|
||||
return {
|
||||
byteLength: (params.storageDelta || 0) * -1,
|
||||
numberOfObjects: (params.objectDelta || 0) * -1,
|
||||
...params,
|
||||
};
|
||||
}
|
||||
|
||||
_convertPushMetricCompleteMultipartUpload(params) {
|
||||
return {
|
||||
oldByteLength: !params.objectDelta ? params.sizeDelta * -1 : null,
|
||||
...params,
|
||||
};
|
||||
}
|
||||
|
||||
_convertGenericPushMetricUploadPart(params) {
|
||||
return {
|
||||
newByteLength: params.incomingBytes,
|
||||
oldByteLength: !params.objectDelta ? params.incomingBytes - params.sizeDelta : null,
|
||||
...params,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = UtapiClient;
|
||||
|
||||
|
|
Loading…
Reference in New Issue