@@ -26,6 +26,7 @@ package trace
2626
2727import (
2828 "encoding/csv"
29+ "encoding/json"
2930 "fmt"
3031 "github.com/gocarina/gocsv"
3132 "github.com/vhive-serverless/loader/pkg/common"
@@ -126,7 +127,7 @@ func (p *AzureTraceParser) Parse(platform string) []*common.Function {
126127 invocationPath := p .DirectoryPath + "/invocations.csv"
127128 runtimePath := p .DirectoryPath + "/durations.csv"
128129 memoryPath := p .DirectoryPath + "/memory.csv"
129- dirigentPath := p .DirectoryPath + "/dirigent.csv "
130+ dirigentPath := p .DirectoryPath + "/dirigent.json "
130131
131132 invocationTrace := parseInvocationTrace (invocationPath , p .duration )
132133 runtimeTrace := parseRuntimeTrace (runtimePath )
@@ -258,21 +259,20 @@ func parseMemoryTrace(traceFile string) *[]common.FunctionMemoryStats {
258259}
259260
260261func parseDirigentMetadata (traceFile string , platform string ) * []common.DirigentMetadata {
261- if platform != "Dirigent " {
262+ if strings . ToLower ( platform ) != "dirigent " {
262263 return nil
263264 }
264265
265266 log .Infof ("Parsing Dirigent metadata: %s" , traceFile )
266267
267- f , err := os .Open (traceFile )
268+ data , err := os .ReadFile (traceFile )
268269 if err != nil {
269- log .Error ("Failed to open trace memory specification file." )
270+ log .Error ("Failed to read Dirigent trace file." )
270271 return nil
271272 }
272- defer f .Close ()
273273
274274 var metadata []common.DirigentMetadata
275- err = gocsv . UnmarshalFile ( f , & metadata )
275+ err = json . Unmarshal ( data , & metadata )
276276 if err != nil {
277277 log .Fatal ("Failed to parse trace runtime specification." )
278278 }
0 commit comments