Skip to content

Commit

Permalink
initial commit of changes for developing progress tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
jigglypuff96 committed Nov 22, 2024
1 parent 26b2d74 commit 1ce407a
Show file tree
Hide file tree
Showing 44 changed files with 1,837 additions and 226 deletions.
98 changes: 50 additions & 48 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Daisen Server",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/daisen",
"args": [
"-csv=sample_trace_small.csv"
],
"env": {
"AKITA_DAISEN_DEV_SERVER": "http://localhost:5173"
}
},
{
"name": "Test github.com/sarchlab/akita/monitoring",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/monitoring"
},
{
"name": "Test github.com/sarchlab/akita",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}"
},
{
"name": "Test github.com/sarchlab/analysis",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/analysis"
},
{
"name": "Test gitlab.com/akita/v3/sim/bottleneckanalysis",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/sim/bottleneckanalysis"
},
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Daisen Server",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/daisen",
"args": [
"-sqlite",
"/Users/gigizhou/Desktop/research/sarchlab/mgpusim/samples/relu/akita_trace_cqvqajgqhqsgsb5j58p0.sqlite3",
"-http=:3001"
],
"env": {
"AKITA_DAISEN_DEV_SERVER": "http://localhost:5173"
}
},
{
"name": "Test github.com/sarchlab/akita/monitoring",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/monitoring"
},
{
"name": "Test github.com/sarchlab/akita",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}"
},
{
"name": "Test github.com/sarchlab/analysis",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/analysis"
},
{
"name": "Test gitlab.com/akita/v3/sim/bottleneckanalysis",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/sim/bottleneckanalysis"
}
]
}
70 changes: 70 additions & 0 deletions analysis/mock_sim_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions daisen/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func startAPIServer() {
http.HandleFunc("/task", serveIndex)

http.HandleFunc("/api/trace", httpTrace)
http.HandleFunc("/api/delay", httpDelayEvents)
http.HandleFunc("/api/progress", httpProgressEvents)
http.HandleFunc("/api/dependency", httpDependencyEvents)
http.HandleFunc("/api/compnames", httpComponentNames)
http.HandleFunc("/api/compinfo", httpComponentInfo)

Expand Down
137 changes: 0 additions & 137 deletions daisen/static/dist/assets/index-78bd0b13.js

This file was deleted.

1 change: 0 additions & 1 deletion daisen/static/dist/assets/index-78bd0b13.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion daisen/static/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script type="module" crossorigin src="/assets/index-78bd0b13.js"></script>
<script type="module" crossorigin src="/assets/index-06e36463.js"></script>
<link rel="stylesheet" href="/assets/index-38135ff7.css">
</head>

Expand Down
57 changes: 57 additions & 0 deletions daisen/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,60 @@ func httpTrace(w http.ResponseWriter, r *http.Request) {
_, err = w.Write(rsp)
dieOnErr(err)
}


func httpDelayEvents(w http.ResponseWriter, r *http.Request) {
source := r.FormValue("source")
query := tracing.DelayQuery{
Source: source,
}

delayEvents := traceReader.ListDelayEvents(query)
delayEventsJSON, err := json.Marshal(delayEvents)
if err != nil {
http.Error(w, "Failed to marshal delay events to JSON", http.StatusInternalServerError)
return
}

// Write the JSON response
w.Header().Set("Content-Type", "application/json")
_, err = w.Write(delayEventsJSON)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
return
}
}


func httpProgressEvents(w http.ResponseWriter, r *http.Request) {

Check failure on line 76 in daisen/trace.go

View workflow job for this annotation

GitHub Actions / Akita Compilation

unnecessary leading newline (whitespace)

source := r.FormValue("source")
query := tracing.ProgressQuery{
Source: source,
}
progressEvents := traceReader.ListProgressEvents(query);
rsp, err := json.Marshal(progressEvents)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
_, err = w.Write(rsp)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}

func httpDependencyEvents(w http.ResponseWriter, r *http.Request) {
dependencyEvents := traceReader.ListDependencyEvents()
rsp, err := json.Marshal(dependencyEvents)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
_, err = w.Write(rsp)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ require (
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
Expand Down
70 changes: 70 additions & 0 deletions mem/cache/writearound/mock_sim_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1ce407a

Please sign in to comment.