-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
134 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Test | ||
run: go test ./pkg/* | ||
run: go test ./internal/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
"log" | ||
"net/http" | ||
"time" | ||
) | ||
|
||
func main() { | ||
for { | ||
makeRequest() | ||
time.Sleep(time.Millisecond * 50) | ||
} | ||
} | ||
|
||
func makeRequest() { | ||
req, err := http.NewRequest("get", "http://localhost:5000/live/09248ef6-c401-4601-8928-5964d61f2c61", nil) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
resp, err := http.DefaultClient.Do(req) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
b, err := io.ReadAll(resp.Body) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
defer resp.Body.Close() | ||
|
||
fmt.Println(string(b)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package actrs | ||
|
||
import ( | ||
"github.com/anthdm/hollywood/actor" | ||
"github.com/anthdm/raptor/internal/types" | ||
) | ||
|
||
// The metric actor is responsible for handling metrics that are being | ||
// sent from the runtimes locally from the same machine. | ||
|
||
const KindMetric = "runtime_metric" | ||
|
||
type Metric struct{} | ||
|
||
func NewMetric() actor.Receiver { | ||
return &Metric{} | ||
} | ||
|
||
// TODO: Store metrics where they belong | ||
func (m *Metric) Receive(c *actor.Context) { | ||
switch msg := c.Message().(type) { | ||
case actor.Started: | ||
case actor.Stopped: | ||
case types.RuntimeMetric: | ||
_ = msg | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package types | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/google/uuid" | ||
) | ||
|
||
// RuntimeMetric holds information about a single runtime execution. | ||
type RuntimeMetric struct { | ||
ID uuid.UUID `json:"id"` | ||
EndpointID uuid.UUID `json:"endpoint_id"` | ||
DeploymentID uuid.UUID `json:"deployment_id"` | ||
RequestURL string `json:"request_url"` | ||
Duration time.Duration `json:"duration"` | ||
StartTime time.Time `json:"start_time"` | ||
StatusCode int `json:"status_code"` | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.