creation_time to use utc timestamp for metrics and events
Change-Id: I7862f0a0e268dabe62a9da0700965cef17dc1fe0
This commit is contained in:
parent
5237ff23f5
commit
6db717e919
|
@ -12,7 +12,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from oslo_utils import timeutils
|
||||
|
||||
|
||||
def transform(event, tenant_id, region):
|
||||
|
@ -22,7 +22,7 @@ def transform(event, tenant_id, region):
|
|||
tenantId=tenant_id,
|
||||
region=region
|
||||
),
|
||||
creation_time=datetime.now()
|
||||
creation_time=timeutils.utcnow_ts()
|
||||
)
|
||||
|
||||
return transformed_event
|
|
@ -12,13 +12,13 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from oslo_utils import timeutils
|
||||
|
||||
|
||||
def transform(metrics, tenant_id, region):
|
||||
transformed_metric = {'metric': {},
|
||||
'meta': {'tenantId': tenant_id, 'region': region},
|
||||
'creation_time': datetime.now()}
|
||||
'creation_time': timeutils.utcnow_ts()}
|
||||
|
||||
if isinstance(metrics, list):
|
||||
transformed_metrics = []
|
||||
|
|
|
@ -26,6 +26,7 @@ keystonemiddleware
|
|||
oslo.config>=1.2.1
|
||||
oslo.middleware
|
||||
oslo.serialization
|
||||
oslo.utils
|
||||
pastedeploy>=1.3.3
|
||||
pbr>=0.6,!=0.7,<1.0
|
||||
python-dateutil>=1.5
|
||||
|
|
Loading…
Reference in New Issue