Title: Aggregates with integer keys · Issue #25 · tmetsch/python-dtrace · GitHub
Open Graph Title: Aggregates with integer keys · Issue #25 · tmetsch/python-dtrace
X Title: Aggregates with integer keys · Issue #25 · tmetsch/python-dtrace
Description: Does python-dtrace support using integer keys in aggregates? Here is a simple example: from dtrace import DTraceConsumerThread from subprocess import check_output, Popen, PIPE, STDOUT import time script = """syscall::read:entry /execname...
Open Graph Description: Does python-dtrace support using integer keys in aggregates? Here is a simple example: from dtrace import DTraceConsumerThread from subprocess import check_output, Popen, PIPE, STDOUT import time s...
X Description: Does python-dtrace support using integer keys in aggregates? Here is a simple example: from dtrace import DTraceConsumerThread from subprocess import check_output, Popen, PIPE, STDOUT import time s...
Opengraph URL: https://github.com/tmetsch/python-dtrace/issues/25
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Aggregates with integer keys","articleBody":"Does `python-dtrace` support using integer keys in aggregates? \r\n\r\nHere is a simple example:\r\n```python\r\nfrom dtrace import DTraceConsumerThread\r\nfrom subprocess import check_output, Popen, PIPE, STDOUT\r\nimport time\r\n\r\nscript = \"\"\"syscall::read:entry /execname == \"dd\"/\r\n{\r\n @values[arg2] = count();\r\n}\"\"\"\r\ncommand = [\"dd\", \"if=/dev/zero\", \"of=/dev/null\", \"status=none\", \"bs=1M\", \"count=10\"]\r\n\r\nprint(\"Running with dtrace-python\")\r\ndtrace_thread = DTraceConsumerThread(script, sleep=1)\r\ndtrace_thread.start()\r\ncheck_output(command)\r\ndtrace_thread.stop()\r\ndtrace_thread.join()\r\n\r\nprint(\"\\nRunning with command line dtrace\")\r\nwith Popen([\"dtrace\", \"-n\", script], stderr=STDOUT, stdout=PIPE) as proc:\r\n time.sleep(0.5) # let dtrace start\r\n check_output(command)\r\n proc.terminate()\r\n print(proc.stdout.read().decode())\r\n```\r\n\r\n`python-dtrace` prints:\r\n```\r\n1793 1 [b'/'] 1\r\n1793 1 [b'\\x80'] 1\r\n1793 1 [b''] 10\r\n```\r\n\r\nThe `dtrace` command prints\r\n```\r\n 47 1\r\n 128 1\r\n 1048576 10\r\n```\r\n\r\nIs there some way to recover the integer aggregate keys from the byte strings returned (`b'/'`, `b'\\x80'`, `b''`), or is this functionality not yet supported?\r\nThanks in advance. \r\n\r\n(I'm using version `0.0.12` installed from master, on FreeBSD 13)","author":{"url":"https://github.com/ictrobot","@type":"Person","name":"ictrobot"},"datePublished":"2021-02-28T16:33:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/25/python-dtrace/issues/25"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:216c568a-4845-05af-4292-506454098938 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D96E:6964C:6ADBC6:882C04:69904E6D |
| html-safe-nonce | d454867e50d1681d95f6bb552438f591e4f8d9e4d057c61feb105b5f8fd8a957 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTZFOjY5NjRDOjZBREJDNjo4ODJDMDQ6Njk5MDRFNkQiLCJ2aXNpdG9yX2lkIjoiNDg0OTQxODcyOTQ0NDAyMDI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b67a67acc3366e4eccc6549ec6df292decde948873a0b9b16ddaa5b6561e5800 |
| hovercard-subject-tag | issue:818247602 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tmetsch/python-dtrace/25/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24ea68429ea6a1a5a5d500342cc781f596478c4aca018e53067e5ef9907aa84f/tmetsch/python-dtrace/issues/25 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24ea68429ea6a1a5a5d500342cc781f596478c4aca018e53067e5ef9907aa84f/tmetsch/python-dtrace/issues/25 |
| og:image:alt | Does python-dtrace support using integer keys in aggregates? Here is a simple example: from dtrace import DTraceConsumerThread from subprocess import check_output, Popen, PIPE, STDOUT import time s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ictrobot |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/tmetsch/python-dtrace git https://github.com/tmetsch/python-dtrace.git |
| octolytics-dimension-user_id | 332745 |
| octolytics-dimension-user_login | tmetsch |
| octolytics-dimension-repository_id | 2530864 |
| octolytics-dimension-repository_nwo | tmetsch/python-dtrace |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2530864 |
| octolytics-dimension-repository_network_root_nwo | tmetsch/python-dtrace |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width