Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add metrics and timing functions #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions api/v1/rainbow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ option go_package = "github.com/converged-computing/rainbow/pkg/api/v1";
// RainbowSchedulerService provides API endpoints for interacting with the central scheduler service
service RainbowScheduler {

// SaveMetric saves a metric to the database
rpc SaveMetric(SaveMetricRequest) returns (SaveMetricResponse);

// Register cluster - request to register a new cluster
rpc Register(RegisterRequest) returns (RegisterResponse);

Expand Down Expand Up @@ -41,6 +44,20 @@ message RegisterRequest {
google.protobuf.Timestamp sent = 5;
}

message SaveMetricRequest {
string name = 1;
string value = 2;
map<string, string> metadata = 3;
}

message SaveMetricResponse {
enum ResultType {
SAVE_METRIC_SUCCESS = 0;
SAVE_METRIC_ERROR = 1;
}
ResultType status = 1;
}

// UpdateStateRequests allows a cluster to set arbitrary metadata
// for its state. State metadata is used for selection algorithms
message UpdateStateRequest {
Expand Down Expand Up @@ -75,6 +92,7 @@ message SubmitJobRequest {
map<string,string> select_options = 5;
bool satisfy_only = 6;
google.protobuf.Timestamp sent = 7;
int64 jobid = 8;

message Cluster {
string name = 1;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/scheduler/rainbow-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ scheduler:
name: match
cluster:
name: keebler
secret: 27933478-5c96-4473-bd47-b829b5d0eaf9
secret: e5ef5cfa-662b-453b-bf43-61836a9c5c5d
graphdatabase:
name: memory
host: 127.0.0.1:50051
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/compspec/jobspec-go v0.0.0-20240510054255-ee02cdc7d3d4
github.com/converged-computing/jsongraph-go v0.0.0-20240229082022-c6887a5a00fe
github.com/fatih/color v1.16.0
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.6.0
github.com/mattn/go-sqlite3 v1.14.22
github.com/neo4j/neo4j-go-driver/v5 v5.20.0
Expand All @@ -19,7 +20,6 @@ require (
)

require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
Expand Down
Loading