示例#1
0
    def meter_sms_actions(self, project_id, receivers):
        ctxt = get_admin_context()
        local_receivers = [r for r in receivers if r.startswith("+82")]
        international_receivers = [
            r for r in receivers if not r.startswith("+82")
        ]

        self.api.put_metric_data(ctxt,
                                 project_id,
                                 namespace="SPCS/SYNAPS",
                                 metric_name="LocalSMSActionCount",
                                 dimensions={},
                                 value=len(local_receivers),
                                 unit="Count",
                                 timestamp=utils.strtime(utils.utcnow()),
                                 is_admin=True)

        self.api.put_metric_data(ctxt,
                                 project_id,
                                 namespace="SPCS/SYNAPS",
                                 metric_name="InternationalSMSActionCount",
                                 dimensions={},
                                 value=len(international_receivers),
                                 unit="Count",
                                 timestamp=utils.strtime(utils.utcnow()),
                                 is_admin=True)

        LOG.audit("Meter SMS: %s %s %s", project_id, len(receivers), receivers)
示例#2
0
 def meter_instance_actions(self, project_id, receivers):
     ctxt = get_admin_context()
     self.api.put_metric_data(ctxt, project_id, namespace="SPCS/SYNAPS",
                              metric_name="InstanceActionCount",
                              dimensions={}, value=len(receivers),
                              unit="Count",
                              timestamp=utils.strtime(utils.utcnow()),
                              is_admin=True)
     LOG.audit("Meter InstanceAction: %s %s %s", project_id, len(receivers),
               receivers)
示例#3
0
 def meter_instance_actions(self, project_id, receivers):
     ctxt = get_admin_context()
     self.api.put_metric_data(ctxt,
                              project_id,
                              namespace="SPCS/SYNAPS",
                              metric_name="InstanceActionCount",
                              dimensions={},
                              value=len(receivers),
                              unit="Count",
                              timestamp=utils.strtime(utils.utcnow()),
                              is_admin=True)
     LOG.audit("Meter InstanceAction: %s %s %s", project_id, len(receivers),
               receivers)
示例#4
0
    def meter_sms_actions(self, project_id, receivers):
        ctxt = get_admin_context()
        local_receivers = [r for r in receivers if r.startswith("+82")]
        international_receivers = [r for r in receivers if not 
                                   r.startswith("+82")]
        
        self.api.put_metric_data(ctxt, project_id, namespace="SPCS/SYNAPS",
                                 metric_name="LocalSMSActionCount",
                                 dimensions={}, value=len(local_receivers),
                                 unit="Count",
                                 timestamp=utils.strtime(utils.utcnow()),
                                 is_admin=True)

        self.api.put_metric_data(ctxt, project_id, namespace="SPCS/SYNAPS",
                                 metric_name="InternationalSMSActionCount",
                                 dimensions={},
                                 value=len(international_receivers),
                                 unit="Count",
                                 timestamp=utils.strtime(utils.utcnow()),
                                 is_admin=True)
        
        LOG.audit("Meter SMS: %s %s %s", project_id, len(receivers), receivers)