Ejemplo n.º 1
0
    def __init__(self):
        self.api_report = api_report_pb2.ApiReport()

        invocation_timestamp = timestamp_pb2.Timestamp()
        invocation_timestamp.GetCurrentTime()
        self.api_report.timestamp.CopyFrom(invocation_timestamp)
        self.api_report.date = invocation_timestamp.ToJsonString()
Ejemplo n.º 2
0
  def write(self, path):
    api_report = api_report_pb2.ApiReport(
        timestamp=self.api_report.timestamp,
        date=self.api_report.date,
        symbol_metric=sorted(
            self.api_report.symbol_metric, key=lambda sm: sm.symbol_name))

    path.write_bytes(api_report.SerializeToString())