Skip to content

Instantly share code, notes, and snippets.

@miketang84
Last active March 14, 2023 06:53
Show Gist options
  • Save miketang84/7ae8bb7998c67c64513df480d91e93ac to your computer and use it in GitHub Desktop.
Save miketang84/7ae8bb7998c67c64513df480d91e93ac to your computer and use it in GitHub Desktop.
8fish Log Explanation

8fish Log Explanation

For post flow

root@3420b30def81:~/eightfish/examples/simple/flow_tests# hurl new_article.hurl {"result":"Ok","id":"9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"}

== http_gate ==

Step 1

req: Request { method: POST, uri: /article/new, version: HTTP/1.1, headers: {"host": "127.0.0.1:3000", "accept": "/", "content-type": "application/x-www-form-urlencoded", "user-agent": "hurl/2.0.1", "content-length": "85", "spin-path-info": "/article/new", "spin-full-url": "http://127.0.0.1:3000/article/new", "spin-matched-route": "/...", "spin-base-path": "/", "spin-raw-component-route": "/...", "spin-component-route": ""}, body: Some(b"title=test111&content=this%20is%20the%20content%20of%20test111&authorname=mike%20tang") }

payload: Object {"reqdata": String("title=test111&content=this%20is%20the%20content%20of%20test111&authorname=mike%20tang"), "reqid": String("c3dfce1e9b394d4dadf65f1fe26ee3ab")}

== subxtproxy ==

Step 3

received msg from channel spin2proxy: Some(Msg { payload: string-data('"{"action":"post","data":[123,34,114,101,113,100,97,116,97,34 ,58,34,116,105,116,108,101,61,116,101,115,116,49,49,49,38,99,111,110,116,101,110,116,61,116,104,105,115,37,50,48,105,115,37,50,48,116,104, 101,37,50,48,99,111,110,116,101,110,116,37,50,48,111,102,37,50,48,116,101,115,116,49,49,49,38,97,117,116,104,111,114,110,97,109,101,61,109,105,107,101,37,50,48,116,97,110,103,34,44,34,114,101,113,105,100,34,58,34,99,51,100,102,99,101,49,101,57,98,51,57,52,100,52,100,97,100,102,54,53,102,49,102,101,50,54,101,101,51,97,98,34,125],"ext":[],"model":"/article/new"}"'), channel: string-data('"spin2proxy"'), pattern: None })

from redis: post: InputOutputObject { model: "/article/new", action: "post", data: [123, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 34, 116, 105, 116, 108, 101, 61, 116, 101, 115, 116, 49, 49, 49, 38, 99, 111, 110, 116, 101, 110, 116, 61, 116, 104, 105, 115, 37, 50, 48, 105, 115, 37, 50, 48, 116, 104, 101, 37, 50, 48, 99, 111, 110, 116, 101, 110, 116, 37, 50, 48, 111, 102, 37, 50, 48, 116, 101, 115, 116, 49, 49, 49, 38, 97, 117, 116, 104, 111, 114, 110, 97, 109, 101, 61, 109, 105, 107, 101, 37, 50, 48, 116, 97, 110, 103, 34, 44, 34, 114, 101, 113, 105, 100, 34, 58, 34, 99, 51, 100, 102, 99, 101, 49, 101, 57, 98, 51, 57, 52, 100, 52, 100, 97, 100, 102, 54, 53, 102, 49, 102, 101, 50, 54, 101, 101, 51, 97, 98, 34, 125], ext: [] }

Step 5

Event at 0x8abe590a4396d630b5bb76c65407c173577137ce67b69d7982968eea6e2299d1: Action event: Action([47, 97, 114, 116, 105, 99, 108, 101, 47, 110, 101, 119], [112, 111, 115, 116], [123, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 34, 116, 105, 116, 108, 101, 61, 116, 101, 115, 116, 49, 49, 49, 38, 99, 111, 110, 116, 101, 110, 116, 61, 116, 104, 105, 115, 37, 50, 48, 105, 115, 37, 50, 48, 116, 104, 101, 37, 50, 48, 99, 111, 110, 116, 101, 110, 116, 37, 50, 48, 111, 102, 37, 50, 48, 116, 101, 115, 116, 49, 49, 49, 38, 97, 117, 116, 104, 111, 114, 110, 97, 109, 101, 61, 109, 105, 107, 101, 37, 50, 48, 116, 97, 110, 103, 34, 44, 34, 114, 101, 113, 105, 100, 34, 58, 34, 99, 51, 100, 102, 99, 101, 49, 101, 57, 98, 51, 57, 52, 100, 52, 100, 97, 100, 102, 54, 53, 102, 49, 102, 101, 50, 54, 101, 101, 51, 97, 98, 34, 125], 1678772220, [125, 39, 28, 175, 255, 89, 177, 127, 166, 84, 231, 6, 95, 97, 35, 158, 150, 248, 36, 221, 166, 84, 228, 235, 157, 191, 174, 177, 227, 18, 134, 22], 0)

Step 11

received msg from channel spin2proxy: Some(Msg { payload: string-data('"{"model":"article","action":"update_index","data":[123,34,114,101,113,105,100,34,58,34,99,51,100,102,99,101,49,101,57,98,51,57,52,100,52,100,97,100,102,54,53,102,49,102,101,50,54,101,101,51,97,98,34,44,34,114,101,113,100,97,116,97,34,58,91,91,34,57,82,89,90,53,105,71,119,113,82,52,105,112,114,72,100,88,107,98,87,72,107,76,100,87,71,105,112,100,76,116,97,81,99,106,122,122,100,83,66,121,100,120,72,34,44,34,99,106,117,111,121,86,120,102,77,79,54,77,73,86,103,72,108,87,108,79,79,75,72,114,121,107,119,111,102,48,108,108,98,52,122,116,88,114,99,79,104,67,49,75,77,73,34,93,93,125],"ext":[]}"'), channel: string-data('"spin2proxy"'), pattern: None })

from redis: update_index: InputOutputObject { model: "article", action: "update_index", data: [123, 34, 114, 101, 113, 105, 100, 34, 58, 3 4, 99, 51, 100, 102, 99, 101, 49, 101, 57, 98, 51, 57, 52, 100, 52, 100, 97, 100, 102, 54, 53, 102, 49, 102, 101, 50, 54, 101, 101, 51, 97 , 98, 34, 44, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 91, 91, 34, 57, 82, 89, 90, 53, 105, 71, 119, 113, 82, 52, 105, 112, 114, 72, 1 00, 88, 107, 98, 87, 72, 107, 76, 100, 87, 71, 105, 112, 100, 76, 116, 97, 81, 99, 106, 122, 122, 100, 83, 66, 121, 100, 120, 72, 34, 44, 34, 99, 106, 117, 111, 121, 86, 120, 102, 77, 79, 54, 77, 73, 86, 103, 72, 108, 87, 108, 79, 79, 75, 72, 114, 121, 107, 119, 111, 102, 48, 108, 108, 98, 52, 122, 116, 88, 114, 99, 79, 104, 67, 49, 75, 77, 73, 34, 93, 93, 125], ext: [] }

from redis: update_index: payload: Payload { reqid: "c3dfce1e9b394d4dadf65f1fe26ee3ab", reqdata: Some([("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQ cjzzdSBydxH", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]) }

Step 13

Event at 0x8c364de57c21179683b399970ac89e4b0dc8b42d6c00d6cfe25136b9962a86d7: IndexUpdated event: IndexUpdated([97, 114, 116, 105, 99, 108, 101], [117, 112, 100, 97, 116, 101, 95, 105, 110, 100, 101, 120], [99, 51, 100, 102, 99, 101, 49, 101, 57, 98, 51, 57, 52, 100, 52, 100, 97, 100, 102, 54, 53, 102, 49, 102, 101, 50, 54, 101, 101, 51, 97, 98, 58, 57, 82, 89, 90, 53, 105, 71, 119, 113, 82, 52, 105, 112, 114, 72, 100, 88, 107, 98, 87, 72, 107, 76, 100, 87, 71, 105, 112, 100, 76, 116, 97, 81, 99, 106, 122, 122, 100, 83, 66, 121, 100, 120, 72], 1678772226)

IndexUpdated event: v: ["c3dfce1e9b394d4dadf65f1fe26ee3ab", "9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"]

== example_simple ==

Step 7

Worker::work: msg_obj: InputOutputObject { model: "/article/new", action: "post", data: [123, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 34, 116, 105, 116, 108, 101, 61, 116, 101, 115, 116, 49, 49, 49, 38, 99, 111, 110, 116, 101, 110, 116, 61, 116, 104, 105, 115, 37, 50, 48, 105, 115, 37, 50, 48, 116, 104, 101, 37, 50, 48, 99, 111, 110, 116, 101, 110, 116, 37, 50, 48, 111, 102, 37, 50, 48, 116, 101, 115, 116, 49, 49, 49, 38, 97, 117, 116, 104, 111, 114, 110, 97, 109, 101, 61, 109, 105, 107, 101, 37, 50, 48, 116, 97, 110, 103, 34, 44, 34, 114, 101, 113, 105, 100, 34, 58, 34, 99, 51, 100, 102, 99, 101, 49, 101, 57, 98, 51, 57, 52, 100, 52, 100, 97, 100, 102, 54, 53, 102, 49, 102, 101, 50, 54, 101, 101, 51, 97, 98, 34, 125], ext: [123, 34, 110, 111, 110, 99, 101, 34, 58, 48, 44, 34, 114, 97, 110, 100, 111, 109, 118, 101, 99, 34, 58, 91, 49, 50, 53, 44, 51, 57, 44, 50, 56, 44, 49, 55, 53, 44, 50, 53, 53, 44, 56, 57, 44, 49, 55, 55, 44, 49, 50, 55, 44, 49, 54, 54, 44, 56, 52, 44, 50, 51, 49, 44, 54, 44, 57, 53, 44, 57, 55, 44, 51, 53, 44, 49, 53, 56, 44, 49, 53, 48, 44, 50, 52, 56, 44, 51, 54, 44, 50, 50, 49, 44, 49, 54, 54, 44, 56, 52, 44, 50, 50, 56, 44, 50, 51, 53, 44, 49, 53, 55, 44, 49, 57, 49, 44, 49, 55, 52, 44, 49, 55, 55, 44, 50, 50, 55, 44, 49, 56, 44, 49, 51, 52, 44, 50, 50, 93, 44, 34, 116, 105, 109, 101, 34, 58, 49, 54, 55, 56, 55, 55, 50, 50, 50, 48, 125] }

Step 8

Worker::work: in post branch: ef_req in handler article_new: _execute_results: Ok(1)

Step 9

Worker::work: in post branch: ef_res: Ok(EightFishResponse { status: Successful, info: Info { model_name: "article", action: "new", target: "9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", extra: "" }, pair_list: Some([("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]), results: Some("[{"id":"9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH","title":"test111","content":"this is the content of test111","authorname":"mike tang"}]") })

in post stuff: new: _execute_results: Ok(1) Worker::work: in post branch: pair_list: [("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]

tail_post_process: payload: Object {"reqid": String("c3dfce1e9b394d4dadf65f1fe26ee3ab"), "reqdata": Array [Array [String("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"), String("cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]]}

Step 10

Worker::work: msg_obj: InputOutputObject { model: "article", action: "update_index", data: [123, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 34, 57, 82, 89, 90, 53, 105, 71, 119, 113, 82, 52, 105, 112, 114, 72, 100, 88, 107, 98, 87, 72, 107, 76, 100, 87, 71, 105, 112, 100, 76, 116, 97, 81, 99, 106, 122, 122, 100, 83, 66, 121, 100, 120, 72, 34, 44, 34, 114, 101, 113, 105, 100, 34, 58, 34, 99, 51, 100, 102, 99, 101, 49, 101, 57, 98, 51, 57, 52, 100, 52, 100, 97, 100, 102, 54, 53, 102, 49, 102, 101, 50, 54, 101, 101, 51, 97, 98, 34, 125], ext: [] } callback: update_index: payload: Payload { reqid: "c3dfce1e9b394d4dadf65f1fe26ee3ab", reqdata: Some("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH") }


For query flow

root@3420b30def81:~/eightfish/examples/simple/flow_tests# hurl --variable id=9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH get_one_article.hurl [{"id":"9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH","title":"test111","content":"this is the content of test111","authorname":"mike tang"}]

== http_gate ==

Step 1

req: Request { method: GET, uri: /article/9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH?id=9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH, version: HTTP/1.1, headers: {"host": "127.0.0.1:3000", "accept": "/", "user-agent": "hurl/2.0.1", "spin-path-info": "/article/9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "spin-full-url": "http://127.0.0.1:3000/article/9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH?id=9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "spin-matched-route": "/...", "spin-base-path": "/", "spin-raw-component-route": "/...", "spin-component-route": ""}, body: Some(b"") }

payload: Object {"reqdata": String("id=9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"), "reqid": String("70ee5568193147f999a22ae345c98278")}

== subxtproxy ==

Step 7

received msg from channel spin2proxy: Some(Msg { payload: string-data('"{"model":"article","action":"check_pair_list","data":[123,34,114,101,113,105,100,34,58,34,55,48,101,101,53,53,54,56,49,57,51,49,52,55,102,57,57,57,97,50,50,97,101,51,52,53,99,57,56,50,55,56,34,44,34,114,101,113,100,97,116,97,34,58,91,91,34,57,82,89,90,53,105,71,119,113,82,52,105,112,114,72,100,88,107,98,87,72,107,76,100,87,71,105,112,100,76,116,97,81,99,106,122,122,100,83,66,121,100,120,72,34,44,34,99,106,117,111,121,86,120,102,77,79,54,77,73,86,103,72,108,87,108,79,79,75,72,114,121,107,119,111,102,48,108,108,98,52,122,116,88,114,99,79,104,67,49,75,77,73,34,93,93,125],"ext":[]}"'), channel: string-data('"spin2proxy"'), pattern: None })

from redis: check_pair_list: InputOutputObject { model: "article", action: "check_pair_list", data: [123, 34, 114, 101, 113, 105, 100, 34, 58, 34, 55, 48, 101, 101, 53, 53, 54, 56, 49, 57, 51, 49, 52, 55, 102, 57, 57, 57, 97, 50, 50, 97, 101, 51, 52, 53, 99, 57, 56, 50, 55, 56, 34, 44, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 91, 91, 34, 57, 82, 89, 90, 53, 105, 71, 119, 113, 82, 52, 105, 112, 114, 72, 100, 88, 107, 98, 87, 72, 107, 76, 100, 87, 71, 105, 112, 100, 76, 116, 97, 81, 99, 106, 122, 122, 100, 83, 66, 121, 100, 120, 72, 34, 44, 34, 99, 106, 117, 111, 121, 86, 120, 102, 77, 79, 54, 77, 73, 86, 103, 72, 108, 87, 108, 79, 79, 75, 72, 114, 121, 107, 119, 111, 102, 48, 108, 108, 98, 52, 122, 116, 88, 114, 99, 79, 104, 67, 49, 75, 77, 73, 34, 93, 93, 125], ext: [] }

from redis: check_pair_list: payload: Payload { reqid: "70ee5568193147f999a22ae345c98278", reqdata: Some([("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]) }

Step 9

from redis: check_pair_list: ret_payload: Object({"reqdata": String("true"), "reqid": String("70ee5568193147f999a22ae345c98278")})

== example_simple ==

Step 3

Worker::work: msg_obj: InputOutputObject { model: "/article/9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", action: "query", data: [123, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 34, 105, 100, 61, 57, 82, 89, 90, 53, 105, 71, 119, 113, 82, 52, 105, 112, 114, 72, 100, 88, 107, 98, 87, 72, 107, 76, 100, 87, 71, 105, 112, 100, 76, 116, 97, 81, 99, 106, 122, 122, 100, 83, 66, 121, 100, 120, 72, 34, 44, 34, 114, 101, 113, 105, 100, 34, 58, 34, 55, 48, 101, 101, 53, 53, 54, 56, 49, 57, 51, 49, 52, 55, 102, 57, 57, 57, 97, 50, 50, 97, 101, 51, 52, 53, 99, 57, 56, 50, 55, 56, 34, 125], ext: [] } Worker::work: in query branch: ef_req

Step 5

in handler article: params: {"id": "9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"}

in handler article: rowset: RowSet { columns: [Column { name: "id", data-type: DbDataType::Str }, Column { name: "title", data-type: DbDataType::Str }, Column { name: "content", data-type: DbDataType::Str }, Column { name: "authorname", data-type: DbDataType::Str }], rows: [[DbValue::Str("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"), DbValue::Str("test111"), DbValue::Str("this is the content of test111"), DbValue::Str("mike tang")]] }

in handler article: results: [Article { id: "9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", title: "test111", content: "this is the content of test111", authorname: "mike tang" }]

Worker::work: in query branch: ef_res: EightFishResponse { status: Successful, info: Info { model_name: "article", action: "get_one", target: "9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", extra: "" }, pair_list: Some([("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]), results: Some("[{"id":"9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH","title":"test111","content":"this is the content of test111","authorname":"mike tang"}]") }

query_string: "select id, hash from article_idhash where id in ('9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH')" chash, hash_from_map: "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI" res.results: Some("[{"id":"9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH","title":"test111","content":"this is the content of test111","authorname":"mike tang"}]")

Worker::work: in query branch: pair_list: [("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH", "cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]

Step 6

tail_query_process: payload: Object {"reqid": String("70ee5568193147f999a22ae345c98278"), "reqdata": Array [Array [String("9RYZ5iGwqR4iprHdXkbWHkLdWGipdLtaQcjzzdSBydxH"), String("cjuoyVxfMO6MIVgHlWlOOKHrykwof0llb4ztXrcOhC1KMI")]]}

Worker::work: msg_obj: InputOutputObject { model: "article", action: "check_pair_list", data: [123, 34, 114, 101, 113, 100, 97, 116, 97, 34, 58, 34, 116, 114, 117, 101, 34, 44, 34, 114, 101, 113, 105, 100, 34, 58, 34, 55, 48, 101, 101, 53, 53, 54, 56, 49, 57, 51, 49, 52, 55, 102, 57, 57, 57, 97, 50, 50, 97, 101, 51, 52, 53, 99, 57, 56, 50, 55, 56, 34, 125], ext: [] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment