func RecordArchiveMetadata(
	functionReports []GathererFunctionReport,
	rec recorder.Interface,
	anonymizer *anonymization.Anonymizer,
) error {
	var m runtime.MemStats
	runtime.ReadMemStats(&m)

	archiveMetadata := record.Record{
		Name: recorder.MetadataRecordName,
		Item: record.JSONMarshaller{Object: ArchiveMetadata{
			StatusReports:              functionReports,
			MemoryAlloc:                m.HeapAlloc,
			Uptime:                     time.Since(programStartTime).Truncate(time.Millisecond).Seconds(),
			IsGlobalObfuscationEnabled: anonymizer != nil,
		}},
	}
	if err := rec.Record(archiveMetadata); err != nil {
		return fmt.Errorf("unable to record archive metadata because of error: %v", err)
	}

	return nil
}
// RecordArchiveMetadata records info about archive and gatherers' reports
RecordArchiveMetadata records info about archive and gatherers' reports
// RecordArchiveMetadata records info about archive and gatherers ' reports
func RecordArchiveMetadata(
	functionReports []GathererFunctionReport,
	rec recorder.Interface,
	anonymizer *anonymization.Anonymizer,
) error {
	var m runtime.MemStats
	runtime.ReadMemStats(&m)
	archiveMetadata := record.Record{
		Name: recorder.MetadataRecordName,
		Item: record.JSONMarshaller{Object: ArchiveMetadata{
			StatusReports:              functionReports,
			MemoryAlloc:                m.HeapAlloc,
			Uptime:                     time.Since(programStartTime).Truncate(time.Millisecond).Seconds(),
			IsGlobalObfuscationEnabled: anonymizer != nil,
		}},
	}
	if err := rec.Record(archiveMetadata); err != nil {
		return fmt.Errorf("unable to record archive metadata because of error: %v", err)
	}
	return nil
}
func RecordArchiveMetadata ( functionReports [ ] GathererFunctionReport , rec recorder . Interface , anonymizer * anonymization . Anonymizer , ) error { var m runtime . MemStats runtime . ReadMemStats ( & m ) archiveMetadata := record . Record { Name : recorder . MetadataRecordName , Item : record . JSONMarshaller { Object : ArchiveMetadata { StatusReports : functionReports , MemoryAlloc : m . HeapAlloc , Uptime : time . Since ( programStartTime ) . Truncate ( time . Millisecond ) . Seconds ( ) , IsGlobalObfuscationEnabled : anonymizer != nil , } } , } if err := rec . Record ( archiveMetadata ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
RecordArchiveMetadata records info about archive and gatherers' reports
RecordArchiveMetadata records info about archive and gatherers ' reports