PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: Azure/WALinuxAgent (python)

Issue:
Track Boot Time in Provision Event
To better understand and break down the provision process please include the boot time in the provision event, or emit a boot event with an appropriate duration.

Pull request:
add uptime to provision event
Closes #1091 

Patch:
diff --git a/azurelinuxagent/pa/provision/cloudinit.py b/azurelinuxagent/pa/provision/cloudinit.py
index 60d42fd2..de07ea93 100644
--- a/azurelinuxagent/pa/provision/cloudinit.py
+++ b/azurelinuxagent/pa/provision/cloudinit.py
@@ -64,7 +64,7 @@ class CloudInitProvisionHandler(ProvisionHandler):
             logger.info("Finished provisioning")
 
             self.report_ready(thumbprint)
-            self.report_event("Provisioning with cloud-init succeeded",
+            self.report_event("Provisioning with cloud-init succeeded ({0})".format(self._get_uptime_seconds()),
                 is_success=True,
                 duration=elapsed_milliseconds(utc_start))
 
diff --git a/azurelinuxagent/pa/provision/default.py b/azurelinuxagent/pa/provision/default.py
index 5d07fdf4..5df572cb 100644
--- a/azurelinuxagent/pa/provision/default.py
+++ b/azurelinuxagent/pa/provision/default.py
@@ -88,7 +88,7 @@ class ProvisionHandler(object):
 
             self.write_provisioned()
 
-            self.report_event("Provisioning succeeded",
+            self.report_event("Provisioning succeeded ({0})".format(self._get_uptime_seconds()),
                 is_success=True,
                 duration=elapsed_milliseconds(utc_start))
 
@@ -125,6 +125,15 @@ class ProvisionHandler(object):
                 continue
         return is_running == is_expected
 
+    @staticmethod
+    def _get_uptime_seconds():
+        try:
+            with open('/proc/uptime') as fh:
+                uptime, _ = fh.readline().split()
+                return uptime
+        except:
+            return 0
+
     def reg_ssh_host_key(self):
         keypair_type = conf.get_ssh_host_keypair_type()
         if conf.get_regenerate_ssh_host_key():


Test patch:
diff --git a/tests/pa/test_provision.py b/tests/pa/test_provision.py
index 1004547b..52098f2f 100644
--- a/tests/pa/test_provision.py
+++ b/tests/pa/test_provision.py
@@ -146,8 +146,12 @@ class TestProvision(AgentTestCase):
 
         ph.run()
 
-        call1 = call("Provisioning succeeded", duration=ANY, is_success=True)
-        ph.report_event.assert_has_calls([call1])
+        self.assertEqual(1, ph.report_event.call_count)
+        positional_args, kw_args = ph.report_event.call_args
+        # [call('Provisioning succeeded (146473.68)', duration=65, is_success=True)]
+        self.assertTrue(re.match(r'Provisioning succeeded \(\d+\.\d+\)', positional_args[0]) is not None)
+        self.assertTrue(isinstance(kw_args['duration'], int))
+        self.assertTrue(kw_args['is_success'])
 
     @distros()
     @patch(
Repository: bojand/ghz (go)

Issue:
UnixTimestamp call template in milliseconds
**Is your feature request related to a problem? Please describe.**
My GPRC interface accepts unix epoch time in milliseconds but the current call template only returns values in seconds.

**Describe the solution you'd like**
I would like an additional call template variable that returns the unix timestamp in milliseconds.


Pull request:
Add Unix Nanosecond timestamp. Fixes #141.
Add TimestampUnixNano to call data as timestamp of the call as unix time in nanoseconds. Fixes #141.

Patch:
diff --git a/runner/call_template_data.go b/runner/call_template_data.go
index 7dae8bd..4a590eb 100644
--- a/runner/call_template_data.go
+++ b/runner/call_template_data.go
@@ -21,7 +21,8 @@ type callTemplateData struct {
 	IsClientStreaming  bool   // whether this call is client streaming
 	IsServerStreaming  bool   // whether this call is server streaming
 	Timestamp          string // timestamp of the call in RFC3339 format
-	TimestampUnix      int64  // timestamp of the call as unix time
+	TimestampUnix      int64  // timestamp of the call as unix time in seconds
+	TimestampUnixNano  int64  // timestamp of the call as unix time in nanoseconds
 }
 
 // newCallTemplateData returns new call template data
@@ -40,6 +41,7 @@ func newCallTemplateData(mtd *desc.MethodDescriptor, workerID string, reqNum int
 		IsServerStreaming:  mtd.IsServerStreaming(),
 		Timestamp:          now.Format(time.RFC3339),
 		TimestampUnix:      now.Unix(),
+		TimestampUnixNano:  now.UnixNano(),
 	}
 }
 
diff --git a/www/docs/calldata.md b/www/docs/calldata.md
index abb275c..4cfc74d 100644
--- a/www/docs/calldata.md
+++ b/www/docs/calldata.md
@@ -39,8 +39,11 @@ type callTemplateData struct {
 	// timestamp of the call in RFC3339 format
 	Timestamp          string
 
-	// timestamp of the call as unix time
+	// timestamp of the call as unix time in seconds
 	TimestampUnix      int64
+
+	// timestamp of the call as unix time in nanoseconds
+	TimestampUnixNano      int64
 }
 ```
 


Test patch:
diff --git a/runner/call_template_data_test.go b/runner/call_template_data_test.go
index 829feb0..4e0fc3a 100644
--- a/runner/call_template_data_test.go
+++ b/runner/call_template_data_test.go
@@ -26,6 +26,7 @@ func TestCallTemplateData_New(t *testing.T) {
 	assert.Equal(t, false, ctd.IsServerStreaming)
 	assert.NotEmpty(t, ctd.Timestamp)
 	assert.NotZero(t, ctd.TimestampUnix)
+	assert.NotZero(t, ctd.TimestampUnixNano)
 }
 
 func TestCallTemplateData_ExecuteData(t *testing.T) {