Skip to content

Commit

Permalink
Changes are requested
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzei committed Dec 4, 2024
1 parent 2dc9015 commit e89da7b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions server/support_packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (p *Plugin) GenerateSupportData(_ *plugin.Context) ([]*model.FileData, erro
result = multierror.Append(result, errors.Wrap(err, "Failed to get the number of connected users for Support Packet"))
}

server, cloud, err := p.instanceCount()
serverICount, cloudICount, err := p.instanceCount()
if err != nil {
result = multierror.Append(result, errors.Wrap(err, "Failed to get the number of instances for Support Packet"))
}
Expand All @@ -41,19 +41,19 @@ func (p *Plugin) GenerateSupportData(_ *plugin.Context) ([]*model.FileData, erro

diagnostics := SupportPacket{
Version: manifest.Version,
InstanceCount: server + cloud,
ServerInstanceCount: server,
CloudInstanceCount: cloud,
InstanceCount: serverICount + cloudICount,
ServerInstanceCount: serverICount,
CloudInstanceCount: cloudICount,
SubscriptionCount: subscriptionCount,
ConnectedUserCount: connectedUserCount,
}
b, err := yaml.Marshal(diagnostics)
body, err := yaml.Marshal(diagnostics)
if err != nil {
return nil, errors.Wrap(err, "Failed to marshal diagnostics")
}

return []*model.FileData{{
Filename: filepath.Join(manifest.Id, "diagnostics.yaml"),
Body: b,
Body: body,
}}, result.ErrorOrNil()
}
16 changes: 8 additions & 8 deletions server/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ func (p *Plugin) OnSendDailyTelemetry() {
args := map[string]interface{}{}

// Jira instances
server, cloud, err := p.instanceCount()
serverICount, cloudICount, err := p.instanceCount()
if err != nil {
p.client.Log.Warn("Failed to get instances for telemetry", "error", err)
} else {
args["instance_count"] = server + cloud
if server > 0 {
args["server_instance_count"] = server
args["instance_count"] = serverICount + cloudICount
if serverICount > 0 {
args["server_instance_count"] = serverICount
}
if cloud > 0 {
args["cloud_instance_count"] = cloud
if cloudICount > 0 {
args["cloud_instance_count"] = cloudICount
}
}

Expand All @@ -45,11 +45,11 @@ func (p *Plugin) OnSendDailyTelemetry() {
}

// Connected users
connected, err := p.userCount()
connectedUsers, err := p.userCount()
if err != nil {
p.client.Log.Warn("Failed to get the number of connected users for telemetry", "error", err)
} else {
args["connected_user_count"] = connected
args["connected_user_count"] = connectedUsers
}

p.TrackEvent("stats", args)
Expand Down

0 comments on commit e89da7b

Please sign in to comment.