The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-01-04

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 batman i think there's something funky when it's the first release...
00:00 batman not sure what
00:13 chandwki is it possible to call $c->render() outside of the routed too method?
00:14 chandwki like say the method I route to calls another method in the same controller, "validate_stuff" or something, and if something is invalid I want to call $c->render to render an error
00:14 chandwki that $c->render call seems to get ignored
00:19 tuna joined #mojo
00:39 chandwki basically I just want a method that will render an error and stop
00:40 Grinnz chandwki: it doesn't matter where it's called, as long as it's on the original controller object
00:40 Grinnz and as long as it hasn't been called already somewhere else
00:41 chandwki huh, but it seems to be just... skipping it
00:41 Grinnz are you sure that code is running? and that no other calls to render() occurred? (injecting warns will help with this)
00:42 chandwki well there is a call to render after it
00:43 Grinnz an action rendering more than once would lead to undefined behavior
00:43 chandwki well... I don't want it to call render again
00:43 chandwki I want it to stop when I call the first render because an error was encountered
00:44 pink_mist so don't call render again then
00:44 Grinnz then you need to either render the error later, instead of the second one, or have some indication that you already rendered so the action shouldn't continue
00:44 chandwki ah, so there is no way to like... abort
00:44 Grinnz for the former way, i use exception objects based on Throwable
00:45 Grinnz there is, by throwing an uncaught exception, but that just results in a 500 error
00:45 Grinnz unless you handle that in hooks
00:45 Grinnz if you use an exception object which you define, you can check that it's that kind of exception, and do something special
00:46 Grinnz alternatively, once you render you can return from the action method that was originally called, and that will end the action
00:50 jberger The problem as I recall it is that the announcement of the module comes before the dependency analysis
00:50 jberger So the check of if a release depends on Mojo basically is checking the previous release
00:51 jberger Unless of course there is no previous release
00:51 jberger That said, in my original version i also checked the dist name for /Mojo/
00:52 jberger And maybe special cased MojoMojo
01:12 aborazmeh joined #mojo
03:12 noganex joined #mojo
03:42 lluad joined #mojo
04:35 lluad joined #mojo
05:04 dboehmer_ joined #mojo
06:09 sh14 joined #mojo
06:18 yukikimoto joined #mojo
06:31 yukikimoto2 joined #mojo
06:33 yukikimoto2 Hello, I start irc and enter mojo channel
06:33 tyldis \o/
06:33 yukikimoto2 Mojolicious is greate project!
07:01 Vandal joined #mojo
07:01 Lee joined #mojo
07:15 dod joined #mojo
07:20 dod joined #mojo
07:33 Lee joined #mojo
07:55 AndrewIsh joined #mojo
07:59 trone joined #mojo
08:00 janl joined #mojo
08:05 janl anyone using influxdb?
08:19 kwa I have at my last $jerb.
08:20 ledet joined #mojo
08:21 janl I collect counters, and want to store them in influx, however influx appears to work with gauges.
08:22 janl and then after I need to graph them
08:22 ledet joined #mojo
08:24 kwa janl: Give me an example of the data you're submitting.
08:24 ledet joined #mojo
08:24 kwa When you say "counters" are you aggregating data and inserting them at time intervals?
08:25 janl router interface byte counter, read off the router every 5 minutes.
08:25 janl it goes monotonously up.
08:26 kwa Ah. So rather than inserting the diff between the last value, you're just inserting the last read?
08:26 abra joined #mojo
08:26 janl that would be the trivial way yes.
08:26 kwa influx is primarly for time-series data, so not sure if it's suitable for what you want.
08:26 janl this _is_ a timeseries.
08:26 janl how the measure is expressed is the issue
08:27 kwa Sorry, I mean the data inserted needs to be different.
08:27 janl the delta
08:27 purl somebody said the delta was trying to get back into the black. or Moose::Manual::Delta
08:27 janl yes
08:27 kwa I think we had this same issue when trying to work with it.
08:27 kwa Hmm, lemme think.
08:28 janl I see that the collectd input plugin supports these things. Having read the source code I can't see how.
08:30 kwa janl: Are you using Grafana for graphing by any chance?
08:30 janl kwa: I could be. not gotten to that yet.
08:30 janl I'm stil puzzeling through influx issues
08:32 janl it looks like grafana graphs can be embedded in "foreign" web apps
08:32 janl which is what I would need in the end
08:32 kwa Yeah. I've used it quite extensively and it's pretty nice.
08:33 janl grafana can do derivative
08:34 kwa derivative(mean(“value”), 1s)
08:34 kwa Erm, I think so.
08:35 kwa I don't think it was part of the UI when I tried so had to do a raw command.
08:35 kwa janl: https://lkhill.com/using-influxdb-grafana-to-display-network-statistics/
08:35 kwa Might be of help.
08:36 cpan_mojo joined #mojo
08:36 cpan_mojo joined #mojo
08:36 cpan_mojo Test-Mojo-Role-Selenium-0.02 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Test-Mojo-Role-Selenium-0.02
08:38 janl kwa: much thanks.  I think I still need to be kind of agressive about data agregation though. >200K time series measured every 5 minutes. our rrd disk is 1TB.
08:40 cpan_mojo joined #mojo
08:41 batman pink_mist: the cpan_mojo --filter regex was wrong, so now I've changed it to '^((Minion)|(Test-)?Mojo(licious|\b))'
08:43 janl kwa: SELECT 8 * derivative(mean("value"),1s) AS "value" FROM "ifHCInOctets"  ... egsactly
08:43 kwa janl: nps. A write every 5 mins doesn't seem so bad though.
08:44 janl kwa: turns into 700 datapoints pr second I think I calculated.
08:45 kwa janl: Ah, I thought you were just writing the value at 5 minute intervals? Doesn't need to be aggregated if you're using DERIVATIVE?
08:45 janl kwa: right, just drop some of them.
08:47 kwa Yeah. Maybe reduce the writes to every minute.
08:47 janl switch to influx, gain query language, loose other nice features of rrd
08:48 kwa To be honest. I found influx slow when scaling up.
08:49 janl and then you suddenly need commercial license
08:49 kwa Might be more stable now. Been several months since I last played with it.
08:49 kwa It was great for monitoring services though.
08:49 janl 1.1.1 now
08:50 kwa I also used it for monitoring successful and unsuccessful Minion job results.
08:51 kwa Great for basic metrics. If you want fancy graphs, influx and grafana will be fine for "see how much data we're using boss!"
08:51 kwa If you want something more specific, shove it in postgresql. :P
08:52 janl I would hate to make postgresql swallow the amount of data we get
08:53 kwa If you want permanence, you might need to do that. If you just want temporary shiny graphs, aggregate before sending to influx (or use the derivative like you mentioned above).
08:54 kwa I remember reading an article how etsy weren't that bothered about how accurate the data is, they just wanted a "feeling" of the amount of data they were getting. Reduced writes/overheads etc. but was still very useful.
08:54 kwa janl: https://codeascraft.com/2011/02/15/measure-anything-measure-everything/
08:54 janl one of my use cases is customer exposed
08:56 kwa janl: Hmm, you might want something like http://www.cacti.net/
08:56 janl I have something like that
08:57 janl 15 year old legacy system using rrd
08:57 janl but it's too hard to get data out of rrd
08:58 kwa Without knowing your full use case. Sounds like you need a collector to write to multiple data sources.
08:59 janl *nod* I have a - now - quite nice collector with plugin architecture to detect different kinds of network equipment and query vendor specific SNMP things.
09:00 janl it then sends the data off to rrdcached for writing to disk.
09:01 janl ... I should be able to use my plugin metadata to configure a grafana dashboard for all of the graphs
09:01 janl all 200K of them
09:01 janl however, it turns out that my rrd2influx script will need some work.
09:02 janl since it copies the derived values stored in the rrd files.
09:03 janl which will then be incompatible with the data collected live.
09:03 janl (my users care for the data, up to 4 years of care...)
09:04 kwa Can't make an omlette without yada yada... :)
09:04 janl without very careful data migration
09:05 janl however - currently it looks like the migration will take a year
09:05 janl so maybe we'll need to run rrd and influx in paralell for 4 years ;-)
09:06 kwa heh - should keep you in a job for a while though. "Can't fire the guy in charge of migrating our data!"
09:09 janl unless I figure out something clever
09:09 janl we can't use influx for the long term storage
09:10 janl since the rrd migration sort of ruins the buiness case for going all in in influx
09:11 janl also means we'll have to stay with rrd for the graphing - for 4 years.
09:11 kwa I wouldn't recommend it. They've changed the data format before, and wouldn't be surprised if they did it again.
09:11 janl I did notice that in the discussions. makes me antsy.
09:11 kwa If you want permanence, as I mentioned, you need it in a proper database, like PostgreSQL.
09:12 janl rrd is pretty permanent
09:12 kwa That can handle dickloads of data. You'll probably run out of money long before it causes you issues.
09:13 kwa Isn't RRD round robin database? I thought the point of it was NOT to be permanent.
09:13 rshadow joined #mojo
09:14 janl well, 4 years is permanent enough
09:14 ribasushi janl: it isn't clear why are you looking for alternatives to rrd - it seems to work for what you are doing, and the switch cost ) both in time and uncertainty) is very high
09:14 ribasushi janl: is there something wrong with RRDs that doesn't give you the proper data or something..?
09:15 janl ribasushi: yes, I've not explained that.  I need to be able to produce events based on our network data: Client X is using >80% of their internet line during business hours. let's upsell them
09:16 janl Service Y is configured in the network, but is not being invoiced. Is there traffic?
09:17 ribasushi janl: so... poll in overlapping steps with https://linux.die.net/man/1/rrdxport ?
09:17 janl Trunk line Z is >80% used => Tell Plan&Build department to get a move on.
09:18 good_news_everyon joined #mojo
09:18 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://github.com/kraih/mojo/compare/59f03213ffc3...d879ee66505e
09:18 good_news_everyon mojo/master 2837a44 Nick Morrott: Correct typo in POD (lintian)...
09:18 good_news_everyon mojo/master d879ee6 Sebastian Riedel: Merge pull request #1027 from knowledgejunkie/lintian-pod-typo...
09:18 good_news_everyon left #mojo
09:20 janl ribasushi: we have some scripts based on that kind of thing, but it's causing too much I/O load. Even with SSD SAN that the RRDs are stored on we're at high i/o-rates
09:20 janl at high % of available IOOPS
09:20 janl influx seems tailored for this
09:21 ribasushi janl: ok so essentially your problem is that the datastore is too slow to query at this point ( you didn't mention that ;)
09:21 rshadow joined #mojo
09:21 janl ribasushi: yes.
09:21 kwa hehe
09:21 sri hahaha, there's a $8999 laptop with a keyboard that has actual cherry brown switches
09:21 janl ribasushi: I have so much context I could share.
09:21 kwa janl: Best to get important stuff like that in early... :p
09:22 sri http://www.mobiletechreview.com/ubbthreads/showflat.php?Number=49765
09:27 sri wish the old ibm thinkpad keyboards made a comeback
09:29 janl that's not a laptop
09:29 janl unless you're a giant
09:30 sri bet it has a full 10 minutes battery life xD
09:31 kwa Just enough time to play some Quake III Arena!
09:31 foursixnine So it's a "Don't take out of home" laptop...
09:35 abra_ joined #mojo
09:39 sri foursixnine: you had the right idea with your pok3r mini keyboard
09:39 foursixnine sri, Explain yourself :P
09:40 sri even if you carry that everywhere you go, it's still more portable than any laptop out there with a decent keyboard ;)
09:41 foursixnine :P
09:42 foursixnine And you can still use it as a hammer! because... why not lol
09:42 * sri ponders getting a Vortex Pok3r
09:42 foursixnine sri, i'm thinking about getting a second one... And ditching the magicforce tho
09:44 foursixnine Filco Majestouch Ninja Minila is also great: https://www.amazon.com/Majestouch-Tactile-Keyboard-FFKB67M-EB/dp/B00BEVVFD0
09:45 sri heh, i remember Phil21 recommending Filco
09:47 sri pok3r looks nicer though
09:48 sri guess i would get it in white though
10:00 janus joined #mojo
10:21 cpan_mojo Test-Mojo-Role-Selenium-0.03 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Test-Mojo-Role-Selenium-0.03
11:08 tchaves joined #mojo
11:11 tchaves joined #mojo
11:22 tchaves joined #mojo
11:23 tchaves joined #mojo
12:07 nic joined #mojo
12:20 dotan_convos Didn't know ojo.pm has a benchmarking method.
12:49 sri yea, and it brought us many performance improvements
12:50 sri note to self... use this web service in some cookbook example :) http://whatthecommit.com/index.json
13:22 gizmomathboy joined #mojo
13:30 aborazmeh joined #mojo
13:35 sh14 joined #mojo
13:44 cpan_mojo Mojolicious-Plugin-AssetPack-1.31 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.31
13:53 yukikimoto joined #mojo
14:10 marty joined #mojo
14:14 yukikimoto joined #mojo
14:27 gryphon joined #mojo
14:29 rshadow joined #mojo
15:01 zivester joined #mojo
15:14 orev joined #mojo
15:17 kes joined #mojo
15:28 rshadow joined #mojo
15:49 dikim joined #mojo
15:51 cpan_mojo Test-Mojo-Role-Selenium-0.04 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Test-Mojo-Role-Selenium-0.04
15:55 perlpilot joined #mojo
16:18 asarch joined #mojo
16:27 cpan_mojo Test-Mojo-Role-Selenium-0.05 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Test-Mojo-Role-Selenium-0.05
17:01 dod joined #mojo
17:02 janus joined #mojo
17:31 stryx` joined #mojo
17:54 PryMar56 joined #mojo
18:13 kes joined #mojo
18:16 kvorg joined #mojo
18:16 blonewolfs joined #mojo
18:16 disputin joined #mojo
18:20 kvorg Hi. I need some advice from a wise one before I create something ugly. I need to handle multiple values (arrays) with forms. An example would be editing host info where any number of CNAMEs can exist and the form would need to list all of them and allow editing, removing and adding them. Do we have some best practice examples for simple minimal solutions?
18:21 kvorg I am afraid I will create a horrible js infused spaghetti monster for no reason :-/
18:21 kvorg (brb)
18:23 mcsnolte joined #mojo
18:26 Pyritic joined #mojo
18:53 noganex joined #mojo
19:06 kvorg joined #mojo
19:17 noganex joined #mojo
19:36 dod joined #mojo
19:49 bwf joined #mojo
19:57 ribasushi joined #mojo
20:18 dabudabu kvorg: I'm not 100% sure what part you're asking about... Do you know the part where you use [] in HTML input names?
20:21 sri the name is irrelevant, just use the same for all input elements and it just works
21:06 marty_ joined #mojo
21:52 batman joined #mojo
21:59 mmorriso joined #mojo
22:02 good_news_everyon joined #mojo
22:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/b47363e7150f9b5321f6f1399b95e8052a6b2ac1
22:02 good_news_everyon mojo/master b47363e Sebastian Riedel: rel_dir methods are not really needed, rel_file works just as well
22:02 good_news_everyon left #mojo
22:02 sri one more thing i realized while researching Mojo::File
22:21 jberger could rel_file just become $home->file->child ?
22:21 jberger or some such
22:22 sri possibly
22:22 sri or $home is just a subclass of Mojo::File
22:24 good_news_everyon joined #mojo
22:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vM3d0
22:24 good_news_everyon mojo/master cfb989c Sebastian Riedel: the list_files method of Mojo::Home is also not needed anymore
22:24 good_news_everyon left #mojo
22:25 sri ok, i like the class much more now
22:25 sri no more scope creep
22:25 kvorg (still at array values for form elemnets) i love it how things just work in Mojolicius, but sometimes I am obviusly actively preventing it to do it's thing
22:27 kvorg if I have multiple values and I want to make a form that would display the current values and make them editable, I only know how to do it by getting all the values and producing mulple input fields
22:27 kvorg i suspect there is a better way to do it with the form helper support - is there a simple example to study?
22:28 jberger the form helper just makes a form element
22:28 kvorg and fills it up with any existing parameters
22:29 sri btw. i'm still not 100% sure about Mojo::File.... so it might not happen at all
22:29 jberger kvorg: no, you have to use an input tag generator for each element
22:30 kvorg jberger: so perhaps I wrap it up in my own tag helper?
22:30 jberger ?
22:30 jberger this sounds like a template to me
22:31 kvorg jberger: ups, yes, you have a point. or at least a block
22:31 jberger actually, I'd probably use Vue for this now
22:31 jberger most of my front-ends are using Vue these days
22:33 kvorg jberger: sorry, i had this feeling that there had to be some support for this particular case somewhere or at least an example of a best practice
22:33 jberger parameter reuse is supported, but I don't think most people need it most of the time
22:34 jberger you use-case is fine, but to have an entire tag-set generator for it is beyond the scope of Mojolicious::Plugin::TagHelpers
22:40 marty joined #mojo
22:41 kvorg when we are here: has
22:41 sri did someone break Net::HTTP again?
22:41 kvorg do you think there is any interest for a table tab helper? (i have one lying around)
22:42 kvorg *tag helper
22:42 sri suddenly it wants to install Crypt::SSLeay
22:42 jberger kvorg: is it similar to https://metacpan.org/pod/Mojolicious::Plugin::ReplyTable#html ?
22:43 genio a release of Net::HTTP happened today
22:43 genio did it break something?
22:44 kvorg jberger: damn, I did not know this pluging 2 years ago when I was exporting xls and cvs from my apps ... looks great
22:45 kvorg but no, mine is just a tag helper that takes arrays of array. I does have some basic colspan and rowspan support, captions and such ...
22:45 purl okay, kvorg.
22:46 sri oalders: Net::HTTP shouldn't depend on Net::SSL i assume
22:46 kvorg but nothing fancy
22:46 oalders sri: did i screw up the deps?
22:47 sri think so
22:47 oalders sri: thanks. will fix!
22:52 * sri never installs Crypt::SSLeay, so it won't clash with Net::SSLeay... so the dep change immediately made my "cpan-outdated | cpanm" fail :)
22:53 kvorg jberger: hasn't been updated for recent Mojolicious in 6 years, blush: https://github.com/kvorg/mojolicious-plugin-tag_helpers_extra/blob/master/lib/Mojolicious/Plugin/TagHelpersExtra.pm
22:54 kvorg I think everything except the tables is now in core anyway https://github.com/kvorg/mojolicious-plugin-tag_helpers_extra
22:54 kvorg ok, thanks for the help, i'll leave you to it now. bye all!
22:59 marty joined #mojo
22:59 good_news_everyon joined #mojo
22:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/bbc6e0c21480d2594f518e85ad331bfa795eb430
22:59 good_news_everyon mojo/master bbc6e0c Sebastian Riedel: bump version
22:59 good_news_everyon left #mojo
22:59 good_news_everyon joined #mojo
22:59 good_news_everyon [mojo] kraih tagged v7.14 at 4ba370a: https://github.com/kraih/mojo/commits/v7.14
22:59 good_news_everyon left #mojo
23:00 disputin joined #mojo
23:09 jberger kvorg: here is a basic app for you: https://gist.github.com/jberger/1c1e301f31232b899d9cae5fe50c4162
23:09 jberger clearly that isn't going to be a simple tag helper
23:10 jberger but hopefully it shows you what you are after
23:10 jberger again, I think a Vue version would be nicer
23:15 kvorg jberger: wow, man, that was very very nice of you!
23:15 kvorg I was planning to overcomplicate, this will keep me straight!
23:49 sri kvorg: maybe you should stop planning that
23:50 preaction can you plan to overplan?

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary