{"id":20057269,"url":"https://github.com/heyoka/dfs","last_synced_at":"2025-05-05T14:31:03.924Z","repository":{"id":37431946,"uuid":"82471769","full_name":"heyoka/dfs","owner":"heyoka","description":" Dataflow Scripting Language | InfluxData's TICKscript for Erlang.","archived":false,"fork":false,"pushed_at":"2025-04-14T11:44:04.000Z","size":1137,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T12:45:28.078Z","etag":null,"topics":["dataflow","dsl","erlang"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/heyoka.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,"zenodo":null}},"created_at":"2017-02-19T16:14:29.000Z","updated_at":"2025-04-14T11:44:08.000Z","dependencies_parsed_at":"2025-04-02T12:29:11.525Z","dependency_job_id":"07d702a4-1d22-40a8-a88e-e8c840dd7ca4","html_url":"https://github.com/heyoka/dfs","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyoka%2Fdfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyoka%2Fdfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyoka%2Fdfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyoka%2Fdfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heyoka","download_url":"https://codeload.github.com/heyoka/dfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252514878,"owners_count":21760452,"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":["dataflow","dsl","erlang"],"created_at":"2024-11-13T12:58:18.082Z","updated_at":"2025-05-05T14:31:03.533Z","avatar_url":"https://github.com/heyoka.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DFS\n\nThis is essentially InfluxData's [TICKscript](https://docs.influxdata.com/kapacitor/v1.4/tick/) for Erlang.\nDone using leex and yecc.\n\n# Why ?\n(I love Erlang and always wanted to try leex and yecc for a DSL.)\n\nThis DSL will be used along with [dataflow](https://github.com/heyoka/dataflow) to build\nan Analytics Framework on top of dataflow computations powered by erlang style message passing.\n\n# Status\nFeature Complete, still more test to add\n\n# Features and Notable Differences from TICKscript\n * For Declarations the keyword 'def' is used instead of 'var'\n * Erlang-Style comments with '%' \n * Regular Expressions start and end with '?'\n * Built-In Functions (math, erlang and custom modules)\n \n * every Declaration can be overridden (includes lists and lambdas) for template usage\n\n# Examples\nDeclaration (String Value)\n\n    def inId = '14.987ew349f9e87fwef'\n    def outId = '202.5dfgs555sa5df5a'\n    def dead_message = 'LOW on CARBONIDE !!!'\n    \nDeclaration (others)\n    \n    def func = lambda: \"rate\" / \"count\"\n    def funMax = lambda: max(\"v1\", \"v2\")\n    def mylist = [1.22, 14.332, 45.5]\n\nDeclaration (Chain)\n\n    def in1 =\n       |stream_in()\n        .from(inId)\n\nUse chain Declaration with another Chain Statement\n\n    in1\n       |deadman(15m, 30)\n        .as(dead_message)\n\nLambda Expressions Parameter\n\n    in1\n      |eval(\n        lambda: \"value\" * \"value\",\n        lambda: 1/\"value2\")\n      .as('value2', 'inv_value2')\n\n    in1\n      |where(lambda: \"host\" == 'server001.example.com'))\n      \nComplex Lambda Expression with if Statement\n\n    def threshold = 333\n    def boolTrue = true\n    def boolFalse = false\n    \n    def in12 =\n        |eval(lambda: if(( \"ts\" \u003e (max(threshold,23.55) + 2)), boolTrue, boolFalse) )\n        .as('ts_greater')\n\nLong Chain Statement with multiple Nodes\n\n    |window()\n     .every(15s)\n     .period(30m)\n     .stats(mean, difference)\n     .field('val')\n     .as('mean', 'diff')\n     % write to outstream\n     |stream_out(outId)\n      .translate(lambda: 5 \u003e \"mean\")\n     |alert()\n      .critical(\n            % alert when point value is more than 3 stdvs away\n            % from running mean\n        lambda: sigma(\"value\") \u003e 3, _global\n     )\n            % alert only when point's timestamp is between these boundaries\n      .when(lambda: hour() \u003e= 8 AND hour \u003c= 18)\n\n# Erlang\n24|25\n\n# Compile\n\n    rebar3 compile\n\n# Build (Lexer, Parser), Run, Test\n\n    $ make\n\n# License\n\nApache2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyoka%2Fdfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheyoka%2Fdfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyoka%2Fdfs/lists"}