-
Notifications
You must be signed in to change notification settings - Fork 247
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
status: map weavelet id to pids for multi
, single
and ssh
deployment.
#767
Conversation
@rgrandl @mwhittaker PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the change. This is a great idea.
You'll also need to fix the single deployer and the ssh deployer, because they use the same status package.
@rgrandl PTAL again. I have tested both |
multi
, single
and ssh
deployment.
@rgrandl I might be able to test on |
Well I configured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I tried the ssh
deployer and it works too.
I think you need to update the dashboard as well. If you do weaver multi dashboard
you will see an error.
These are the changes you need to do:
diff --git a/internal/status/dashboard.go b/internal/status/dashboard.go
index ca821c1..ef55fd6 100644
--- a/internal/status/dashboard.go
+++ b/internal/status/dashboard.go
@@ -54,10 +54,17 @@ var (
deploymentHTML string
deploymentTemplate = template.Must(template.New("deployment").Funcs(template.FuncMap{
"shorten": logging.ShortenComponent,
- "pidjoin": func(pids []int64) string {
- s := make([]string, len(pids))
- for i, x := range pids {
- s[i] = fmt.Sprint(x)
+ "pidjoin": func(replicas []*Replica) string {
+ s := make([]string, len(replicas))
+ for i, x := range replicas {
+ s[i] = fmt.Sprint(x.Pid)
+ }
+ return strings.Join(s, ", ")
+ },
+ "widjoin": func(replicas []*Replica) string {
+ s := make([]string, len(replicas))
+ for i, x := range replicas {
+ s[i] = x.WeaveletId[0:8]
}
return strings.Join(s, ", ")
},
diff --git a/internal/status/templates/deployment.html b/internal/status/templates/deployment.html
index 2ae661b..5753bbc 100644
--- a/internal/status/templates/deployment.html
+++ b/internal/status/templates/deployment.html
@@ -152,14 +152,16 @@
<th>Component</th>
<th>Replication</th>
<th>PIDs</th>
+ <th>Weavelet IDs</th>
</tr>
</thead>
<tbody>
{{range $c := .Components}}
<tr>
<td>{{shorten $c.Name}}</td>
- <td>{{len $c.Pids}}</td>
- <td>{{pidjoin $c.Pids}}</td>
+ <td>{{len $c.Replicas}}</td>
+ <td>{{pidjoin $c.Replicas}}</td>
+ <td>{{widjoin $c.Replicas}}</td>
</tr>
{{end}}
</tbody>
internal/status/status.go
Outdated
weaveletIds := make([]string, len(component.Replicas)) | ||
for i, replica := range component.Replicas { | ||
pids[i] = fmt.Sprint(replica.Pid) | ||
if len(replica.WeaveletId) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should let it crash here. If we don't set the weavelet id somehow, we shouldn't hide it.
As of now weaver logs shows the weavelet id and `weaver multi status` shows the respective `pid` but its hard to map weavelet id from the logs to the running process, following commit adds weavelet id with the pids of the components so its easier to debug. Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Extends work in PR ServiceWeaver#767 to refect weavelet id on status dashboard as well. Thanks to @rgrandl for diff provided here: ServiceWeaver#767 (review) Signed-off-by: flouthoc <flouthoc.git@gmail.com>
@rgrandl Please take a look again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks a lot!
There is no status command in the |
@flouthoc can you also run |
Context: ServiceWeaver#767 (comment) Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Context: ServiceWeaver#767 (comment) Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Context: ServiceWeaver#767 (comment) Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Run `./dev/build_and_test tidy generate build vet test testrace` on source. Signed-off-by: flouthoc <flouthoc.git@gmail.com>
As of now weaver logs shows the weavelet id but not
pids
andweaver multi status
shows the respectivepid
but its hard to map weavelet id from the logs to the running process, following commit adds weavelet id with the pids of the components so its easier to debug.