Skip to content

Commit

Permalink
Changed function identifier to include hashOwner and hashApp
Browse files Browse the repository at this point in the history
Signed-off-by: aryans1204 <arshar1204@gmail.com>
  • Loading branch information
aryans1204 committed Feb 18, 2025
1 parent 68f5080 commit 76731d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func runTraceMode(cfg *config.LoaderConfiguration, readIATFromFile bool, writeIA
TraceGranularity: parseTraceGranularity(cfg),
TraceDuration: durationToParse,

YAMLPath: yamlPath, //make a slice of YAMLPaths instead
YAMLPath: yamlPath,
TestMode: false,

Functions: functions,
Expand Down
12 changes: 6 additions & 6 deletions data/traces/example/mapper_output.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"c13acdc7567b225971cef2416a3a2b03c8a4d8d154df48afe75834e2f5c59ddf": {
"c13acdc7567b225971cef2416a3a2b03c8a4d8d154df48afe75834e2f5c59ddfc455703077a17a9b8d0fc655d939fcc6d24d819fa9a1066b74f710c35a43cbc868baea05aa0c3619b6feb78c80a07e27e4e68f921d714b8125f916c3b3370bf2": {
"proxy-function": "cartservice"
},
"a2faad786b3c813b12ce57d349d5e62f6d0f22ceecfa86cd72a962853383b600": {
"a2faad786b3c813b12ce57d349d5e62f6d0f22ceecfa86cd72a962853383b600d7028b01f2422ea9d4f695cae4085800eb34540674081a46bb4e4388e7995f7ac8b8b9160f181010f509ee0af3266cbcb5a5f4c7700ba8d4396f1147e1ad3bbd": {
"proxy-function": "image-rotate-go-11"
},
"7dc5aeabc131669912e8c793c8925cc9928321f45f13a4af031592b4611630d7": {
"proxy-function": "video-processing-python-10"
},
"ae8a1640fa932024f59b38a0b001808b5c64612bd60c6f3eb80ba9461ba2d091": {
"7dc5aeabc131669912e8c793c8925cc9928321f45f13a4af031592b4611630d70728f480194febeddbc0d2a69a2cb38344e495f264d52c62102e7bd99505dbf22cc1c836a3b32265b4a36b6e6f56b2d7c0588a926df5d03a76b7b4388cbf2258": {
"proxy-function": "video-processing-python-100"
},
"ae8a1640fa932024f59b38a0b001808b5c64612bd60c6f3eb80ba9461ba2d09101d1a13d091b0cfc764a125ead054ad6a720cb29b0b1fc2c187e9be3311f09fe90ba6ab2b1b9f5b5925d1e9ee6242d0f840ebcfb3221567bc2b5f24cb864b016": {
"proxy-function": "video-processing-python-10"
}
}
4 changes: 3 additions & 1 deletion pkg/trace/mapper_trace_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func (p *MapperTraceParser) extractFunctions(mapperOutput map[string]map[string]
for i := 0; i < len(*invocations); i++ {
invocationStats := (*invocations)[i]
hashFunction := invocationStats.HashFunction
proxyFunction := mapperOutput[hashFunction]["proxy-function"]
hashApp := invocationStats.HashApp
hashOwner := invocationStats.HashOwner
proxyFunction := mapperOutput[hashFunction+hashOwner+hashApp]["proxy-function"]
yamlPath := deploymentInfo[proxyFunction].YamlLocation
predeploymentPaths := deploymentInfo[proxyFunction].PredeploymentPath
function := &common.Function{
Expand Down
2 changes: 1 addition & 1 deletion pkg/trace/test_data/mapper_output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"c13acdc7567b225971cef2416a3a2b03c8a4d8d154df48afe75834e2f5c59ddf": {
"c13acdc7567b225971cef2416a3a2b03c8a4d8d154df48afe75834e2f5c59ddfc455703077a17a9b8d0fc655d939fcc6d24d819fa9a1066b74f710c35a43cbc868baea05aa0c3619b6feb78c80a07e27e4e68f921d714b8125f916c3b3370bf2": {
"proxy-function": "cartservice"
}
}

0 comments on commit 76731d5

Please sign in to comment.