// Copyright 2011 Google Inc. All Rights Reserved

// These are protobufs used in various analysis jobs.

syntax = "proto2";

import "grr_response_proto/jobs.proto";
import "grr_response_proto/semantic.proto";


// A graph is a way to represent data.
message Sample {
  optional string label = 1;
  optional uint64 x_value = 2;
  optional uint64 y_value = 3;
};

message SampleFloat {
  optional string label = 1;
  optional float x_value = 2;
  optional float y_value = 3;
};

message Graph {
  optional string title = 1;
  optional string xtitle = 2;
  optional string ytitle = 3;
  repeated Sample data = 4;
  optional uint32 x_scale = 5 [default = 1];
  optional uint32 y_scale = 6 [default = 1];
};

message GraphFloat {
  optional string title = 1;
  optional string xtitle = 2;
  optional string ytitle = 3;
  repeated SampleFloat data = 4;
  optional uint32 x_scale = 5 [default = 1];
  optional uint32 y_scale = 6 [default = 1];
};

// The following relate to the timelining functionality.
message Event {
  optional uint64 timestamp = 1 [(sem_type) = {
      type: "RDFDatetime",
      description: "The event timestamp."
    }];

  optional string source = 2 [(sem_type) = {
      type: "RDFURN",
      description: "The urn of the originating object for this event.",
    }];

  // The name of the object which this event is talking about.
  optional string subject = 3;

  // The type of this event.
  optional string type = 4;
  optional StatEntry stat = 5;

  // The sequential number of this event as stored in the time series.
  optional uint32 id = 6;
};
