@@ -1164,6 +1164,105 @@ func NewGzipRecord(blr BaseRecord) (GzipRecord, error) {
11641164 return record , nil
11651165}
11661166
1167+ // MSE4NewObjectRecord holds MSE4 new object timing data
1168+ type MSE4NewObjectRecord struct {
1169+ BaseRecord
1170+ AllocationChunks int64 // Number of allocation chunks created
1171+ BytesProcessed SizeValue // Number of bytes processed
1172+ TimeElapsed time.Duration // Time elapsed between object creation and finalization (seconds)
1173+ TimeMSE4Processing time.Duration // Total time spent on MSE4 processing (seconds)
1174+ TimeMemoryAllocation time.Duration // Time spent allocating memory (seconds)
1175+ TimeResourceWait time.Duration // Time spent waiting for resource acquisition (seconds) [persisted only]
1176+ TimeDiskIOFetch time.Duration // Time spent waiting for disk IO during fetch (seconds) [persisted only]
1177+ TimeDiskIOFinalize time.Duration // Time spent waiting for disk IO during finalization (seconds) [persisted only]
1178+ IsPersisted bool // Whether this object was persisted to disk
1179+ }
1180+
1181+ func (r MSE4NewObjectRecord ) String () string {
1182+ s := fmt .Sprintf (
1183+ "%d chunks | %s processed | %s elapsed | %s MSE4 | %s mem alloc" ,
1184+ r .AllocationChunks ,
1185+ r .BytesProcessed .String (),
1186+ r .TimeElapsed ,
1187+ r .TimeMSE4Processing ,
1188+ r .TimeMemoryAllocation ,
1189+ )
1190+
1191+ if r .IsPersisted {
1192+ s += fmt .Sprintf (
1193+ " | %s resource wait | %s disk IO fetch | %s disk IO finalize" ,
1194+ r .TimeResourceWait ,
1195+ r .TimeDiskIOFetch ,
1196+ r .TimeDiskIOFinalize ,
1197+ )
1198+ }
1199+
1200+ return s
1201+ }
1202+
1203+ func NewMSE4NewObjectRecord (blr BaseRecord ) (MSE4NewObjectRecord , error ) {
1204+ parts := strings .Fields (blr .GetRawValue ())
1205+ if len (parts ) != 5 && len (parts ) != 8 {
1206+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, expected 5 or 8 fields, got %d on line %q" , len (parts ), blr .GetRawLog ())
1207+ }
1208+
1209+ record := MSE4NewObjectRecord {BaseRecord : blr }
1210+ record .IsPersisted = len (parts ) == 8
1211+
1212+ allocationChunks , err := strconv .ParseInt (parts [0 ], 10 , 64 )
1213+ if err != nil {
1214+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for allocationChunks on line %q" , blr .GetRawLog ())
1215+ }
1216+ record .AllocationChunks = allocationChunks
1217+
1218+ bytesProcessed , err := strconv .ParseInt (parts [1 ], 10 , 64 )
1219+ if err != nil {
1220+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for bytesProcessed on line %q" , blr .GetRawLog ())
1221+ }
1222+ record .BytesProcessed = SizeValue (bytesProcessed )
1223+
1224+ timeElapsed , err := strconv .ParseFloat (parts [2 ], 64 )
1225+ if err != nil {
1226+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for timeElapsed on line %q" , blr .GetRawLog ())
1227+ }
1228+ record .TimeElapsed = time .Duration (timeElapsed * float64 (time .Second ))
1229+
1230+ timeMSE4Processing , err := strconv .ParseFloat (parts [3 ], 64 )
1231+ if err != nil {
1232+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for timeMSE4Processing on line %q" , blr .GetRawLog ())
1233+ }
1234+ record .TimeMSE4Processing = time .Duration (timeMSE4Processing * float64 (time .Second ))
1235+
1236+ timeMemoryAllocation , err := strconv .ParseFloat (parts [4 ], 64 )
1237+ if err != nil {
1238+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for timeMemoryAllocation on line %q" , blr .GetRawLog ())
1239+ }
1240+ record .TimeMemoryAllocation = time .Duration (timeMemoryAllocation * float64 (time .Second ))
1241+
1242+ // Parse optional persisted object fields
1243+ if record .IsPersisted {
1244+ timeResourceWait , err := strconv .ParseFloat (parts [5 ], 64 )
1245+ if err != nil {
1246+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for timeResourceWait on line %q" , blr .GetRawLog ())
1247+ }
1248+ record .TimeResourceWait = time .Duration (timeResourceWait * float64 (time .Second ))
1249+
1250+ timeDiskIOFetch , err := strconv .ParseFloat (parts [6 ], 64 )
1251+ if err != nil {
1252+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for timeDiskIOFetch on line %q" , blr .GetRawLog ())
1253+ }
1254+ record .TimeDiskIOFetch = time .Duration (timeDiskIOFetch * float64 (time .Second ))
1255+
1256+ timeDiskIOFinalize , err := strconv .ParseFloat (parts [7 ], 64 )
1257+ if err != nil {
1258+ return MSE4NewObjectRecord {}, fmt .Errorf ("conversion to MSE4NewObjectRecord failed, bad value for timeDiskIOFinalize on line %q" , blr .GetRawLog ())
1259+ }
1260+ record .TimeDiskIOFinalize = time .Duration (timeDiskIOFinalize * float64 (time .Second ))
1261+ }
1262+
1263+ return record , nil
1264+ }
1265+
11671266/* BaseRecord aliases */
11681267
11691268// EndRecord marks the end of a transaction
0 commit comments