{"id":27794409,"url":"https://github.com/lis0x90/tslat","last_synced_at":"2025-06-29T00:33:02.875Z","repository":{"id":93233178,"uuid":"149800692","full_name":"lis0x90/tslat","owner":"lis0x90","description":"Enrich your log with timestamp delta","archived":false,"fork":false,"pushed_at":"2019-08-29T13:53:12.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T19:07:06.661Z","etag":null,"topics":["delta","log","logging","timestamp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lis0x90.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-21T18:11:01.000Z","updated_at":"2019-08-29T13:53:14.000Z","dependencies_parsed_at":"2023-04-25T02:20:51.967Z","dependency_job_id":null,"html_url":"https://github.com/lis0x90/tslat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lis0x90/tslat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lis0x90%2Ftslat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lis0x90%2Ftslat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lis0x90%2Ftslat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lis0x90%2Ftslat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lis0x90","download_url":"https://codeload.github.com/lis0x90/tslat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lis0x90%2Ftslat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262518102,"owners_count":23323301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delta","log","logging","timestamp"],"created_at":"2025-04-30T19:07:05.857Z","updated_at":"2025-06-29T00:33:02.828Z","avatar_url":"https://github.com/lis0x90.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tslat\nAs of first step to do performance review of your application is look to your log files. But it may be so tedious to calc time delta between two adjacent log lines. \nThis tool is to resquie! It's calculates timestamp delta between to adjacent log lines and out in format you may specify. \n\nLet's suppose we have following log lines in file:\n```console \n2018-09-21 14:43:59,832 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Get evolution scripts by: META-INF/dbevolution/accounting/.index\n2018-09-21 14:43:59,845 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Got evolution files: List(1.sql, 2.sql, 3.sql, 4.sql)\n2018-09-21 14:43:59,846 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Found: META-INF/dbevolution/accounting/1.sql\n2018-09-21 14:43:59,852 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Found: META-INF/dbevolution/accounting/2.sql\n```\n\nAnd we want to see time delta between timestamps on each log line. We can estimate performance of each operation on high level, for example.\nDownload and run this nifty tool:\n```console\n$cat server.log | tslat -delta-format \"%9d|\" \n        0| 2018-09-21 14:43:59,832 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Get evolution scripts by: META-INF/dbevolution/accounting/.index\n       13| 2018-09-21 14:43:59,845 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Got evolution files: List(1.sql, 2.sql, 3.sql, 4.sql)\n        1| 2018-09-21 14:43:59,846 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Found: META-INF/dbevolution/accounting/1.sql\n        6| 2018-09-21 14:43:59,852 DEBUG [main] r.k.u.d.ClasspathScriptLocator - Found: META-INF/dbevolution/accounting/2.sql\n```\nI prefer to separate delta value from the rest of logs by `|` char, so I added parameter `-delta-format`. It's simplifies further logs processing by other tools like `sed` or `awk`.\n\n# help\nAs usually:\n```console\n\n$ tslat --help\nUsage of ./tslat:\n  -date-length int\n        Length of date string from line start (default 23)\n  -delta-format string\n        Timestamp delta output format in golang Sprinf() syntax (default \"%9d\")\n  -input string\n        Input file path. Stdin will be used if its option is ommited\n  -threshold int\n        Filter out lines with timestamp delta lesser than specified threshold\n```\n\nNote! All time deltas, if not stated others, is treated as microseconds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flis0x90%2Ftslat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flis0x90%2Ftslat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flis0x90%2Ftslat/lists"}