Skip to content

Commit

Permalink
Merge pull request #358 from PrimalPimmy/profix
Browse files Browse the repository at this point in the history
Changed PodName to ContainerName
  • Loading branch information
PrimalPimmy authored Aug 28, 2023
2 parents 1675c30 + ca2cc51 commit 4151d6e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions profile/Client/profileClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (

// Column keys
const (
ColumnNamespace = "Namespace"
ColumnPodname = "Podname"
ColumnProcessName = "Procname"
ColumnResource = "Resource"
ColumnResult = "Result"
ColumnCount = "Count"
ColumnTimestamp = "Timestamp"
ColumnNamespace = "Namespace"
ColumnContainerName = "ContainerName"
ColumnProcessName = "ProcName"
ColumnResource = "Resource"
ColumnResult = "Result"
ColumnCount = "Count"
ColumnTimestamp = "Timestamp"
)

var errbuf bytes.Buffer
Expand Down Expand Up @@ -104,7 +104,7 @@ func generateColumns(Operation string) []table.Column {

Namespace := table.NewFlexColumn(ColumnNamespace, "Namespace", 2).WithStyle(ColumnStyle).WithFiltered(true)

PodName := table.NewFlexColumn(ColumnPodname, "Podname", 4).WithStyle(ColumnStyle).WithFiltered(true)
ContainerName := table.NewFlexColumn(ColumnContainerName, "ContainerName", 4).WithStyle(ColumnStyle).WithFiltered(true)

ProcName := table.NewFlexColumn(ColumnProcessName, "ProcessName", 3).WithStyle(ColumnStyle).WithFiltered(true)

Expand All @@ -119,7 +119,7 @@ func generateColumns(Operation string) []table.Column {

return []table.Column{
Namespace,
PodName,
ContainerName,
ProcName,
Resource,
Result,
Expand Down Expand Up @@ -228,13 +228,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case klog.EventInfo:
profile.TelMutex.RLock()
m.File = m.File.WithRows(generateRowsFromData(profile.Telemetry, "File")).WithColumns(generateColumns("File"))
m.File = m.File.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnPodname).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.File = m.File.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnContainerName).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.Process = m.Process.WithRows(generateRowsFromData(profile.Telemetry, "Process")).WithColumns(generateColumns("Process"))
m.Process = m.Process.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnPodname).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.Process = m.Process.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnContainerName).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.Network = m.Network.WithRows(generateRowsFromData(profile.Telemetry, "Network")).WithColumns(generateColumns("Network"))
m.Network = m.Network.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnPodname).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.Network = m.Network.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnContainerName).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.Syscall = m.Syscall.WithRows(generateRowsFromData(profile.Telemetry, "Syscall")).WithColumns(generateColumns("Syscall"))
m.Syscall = m.Syscall.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnPodname).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
m.Syscall = m.Syscall.SortByAsc(ColumnNamespace).ThenSortByAsc(ColumnContainerName).ThenSortByAsc(ColumnProcessName).ThenSortByAsc(ColumnCount).ThenSortByAsc(ColumnResource)
profile.TelMutex.RUnlock()

return m, waitForActivity()
Expand Down Expand Up @@ -417,13 +417,13 @@ func generateRowsFromData(data []pb.Log, Operation string) []table.Row {
finalmap := AggregateSummary(w, Operation)
for r, frequency := range finalmap {
row := table.NewRow(table.RowData{
ColumnNamespace: r.Namespace,
ColumnPodname: r.ContainerName,
ColumnProcessName: r.Process,
ColumnResource: r.Resource,
ColumnResult: r.Result,
ColumnCount: frequency.freq,
ColumnTimestamp: frequency.time,
ColumnNamespace: r.Namespace,
ColumnContainerName: r.ContainerName,
ColumnProcessName: r.Process,
ColumnResource: r.Resource,
ColumnResult: r.Result,
ColumnCount: frequency.freq,
ColumnTimestamp: frequency.time,
})
s.rows = append(s.rows, row)
}
Expand Down

0 comments on commit 4151d6e

Please sign in to comment.