[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14313877#comment-14313877 ] ASF subversion and git services commented on TS-3346: - Commit c99e5265e6ceac1f74994062aa974030d08746a1 in trafficserver's branch refs/heads/master from [~kichan] [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=c99e526 ] TS-3346: support TS stat api in lua plugin Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14313889#comment-14313889 ] ASF subversion and git services commented on TS-3346: - Commit e5136cff38712aac552230845253db774ee8fc9a in trafficserver's branch refs/heads/master from [~kichan] [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=e5136cf ] TS-3346: fix build error Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14313959#comment-14313959 ] ASF subversion and git services commented on TS-3346: - Commit bcb6abdbdf32db9e382ca1fc609f4acb05ff92d1 in trafficserver's branch refs/heads/master from [~kichan] [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=bcb6abd ] TS-3346: fix doc error Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14311451#comment-14311451 ] Kit Chan commented on TS-3346: -- yeah. for sure we can do something more elegant ts.stat_create(name of metric, type, persistence, sync) stat = ts.stat_find(name of metric) stat:increment(incr) stat:decrement(decr) value = stat:get_value() stat:set_value(value) operator overload is possible in lua but not for the assignment. So probably need to give more thoughts on that later on. But it should be a good start. Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14311603#comment-14311603 ] Leif Hedstrom commented on TS-3346: --- Sounds good. So, I'm not particularly familiar with our Lua APIs, so the above was merely a suggestion, if it doesn't fit in with the current model, then that's fine. I also don't know if there are easy ways for the plugins to remember the stats in between invocations, or if it has to do a lookup on each of them every time (which could get expensive for sure). I also kinda see the plugin as experimental for a while, until we figure out exactly how and where our Lua strategy goes. :) Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14310852#comment-14310852 ] Kit Chan commented on TS-3346: -- Tentatively the lua api will look like this ts.stat_create(some_counter, persistence, sync) ts.stat_increment(some_counter) ts.stat_decrement(some_counter) ts.stat_get(some_counter) ts.stat_set(some_counter) perisistenc can be TS_LUA_STAT_PERSISTENT, TS_LUA_STAT_NON_PERSISTENT sync can be TS_LUA_STAT_SYNC_SUM, TS_LUA_STAT_SYNC_COUNT, TS_LUA_STAT_SYNC_AVG, TS_STAT_SYNC_TIMEAVG Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14311060#comment-14311060 ] Leif Hedstrom commented on TS-3346: --- I don't know much about lua, but it seems like it ought to be able to figure that out. So, couldn't ts.stat_create() create int, float and string types, and when you do ts.stat_increment(), it knows what type this is? Also, now that I think about this, the format seems odd to me. Is the intent that you'd lookup the metric by string every time? Why not e.g. {code} stat = ts.stat_create(name of metric, type, persistence, sync) {code} and then {code} stat.increment() {code} or even {code} stat = stat + 12 {code} etc. ? You would also need a lookup mechanism, e.g. my_stat = ts.stat_find(name) I understand the plugin is not frozen, and we develop as we learn. But it feels we ought to take better advantage of Lua's high level language features, no ? Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14311007#comment-14311007 ] Kit Chan commented on TS-3346: -- [~zwoop] , that's true. Perhaps we can name them as int version at this point. Also, increment and decrement TS APIs take an amount value as well. ts.stat_int_create(some_counter, type, persistence, sync) ts.stat_int_increment(some_counter, amount) ts.stat_int_decrement(some_counter, amount) ts.stat_int_get(some_counter) value = ts.stat_int_set(some_counter) perisistence can be TS_LUA_STAT_PERSISTENT, TS_LUA_STAT_NON_PERSISTENT sync can be TS_LUA_STAT_SYNC_SUM, TS_LUA_STAT_SYNC_COUNT, TS_LUA_STAT_SYNC_AVG, TS_LUA_STAT_SYNC_TIMEAVG Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14310949#comment-14310949 ] Leif Hedstrom commented on TS-3346: --- I doesn't take a type? Or is that implied by something else ? I understand that our C APIs only support integers for now, however, the intent to do that is there. So should we not do the same for the corresponding Lua APIs? Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-3346) Support TS Stat API in Lua
[ https://issues.apache.org/jira/browse/TS-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14297279#comment-14297279 ] Kit Chan commented on TS-3346: -- I will take a look and hope to provide this feature early next week. Thanks for the suggestion. Support TS Stat API in Lua -- Key: TS-3346 URL: https://issues.apache.org/jira/browse/TS-3346 Project: Traffic Server Issue Type: Improvement Components: Lua Reporter: Wei Sun Assignee: Kit Chan Fix For: 5.3.0 Lua script supports to read/collect error rate, timeout rate, avg latency by origin host. -- This message was sent by Atlassian JIRA (v6.3.4#6332)