These are chat archives for ManageIQ/manageiq/performance

8th
Feb 2018
Daniel Berger
@djberg96
Feb 08 2018 16:56
nah, that was a super difficult one to track down - it was the last place where anyone would have looked
@NickLaMuro what do you think of just altering ProcTable.ps to take a hash of arguments (or **kwargs)
Nick LaMuro
@NickLaMuro
Feb 08 2018 17:14
I think I would prefer def ps(pid, opts={}) myself. It's as backwards compatible as possible (even on versions of ruby we don't support any more)
Chris Arcand
@chrisarcand
Feb 08 2018 17:15
Pssh :stuck_out_tongue_winking_eye:
Keenan Brock
@kbrock
Feb 08 2018 17:18
ugh. sometimes I wish in sql, that null == null
Daniel Berger
@djberg96
Feb 08 2018 17:22
@NickLaMuro yeah, but then you end up having to do ps(nil, {}) when you want everything
which feels awkward
Keenan Brock
@kbrock
Feb 08 2018 17:22
you could make the pid optional
Daniel Berger
@djberg96
Feb 08 2018 17:23
it is optional
Nick LaMuro
@NickLaMuro
Feb 08 2018 17:23
oh, I mean, def ps(pid = nil, opts = {})
Keenan Brock
@kbrock
Feb 08 2018 17:23
options, pid = pid, nil if pid.kind_of?(Hash)
so they could call ps(1, options) or ps(options) or ps()
Daniel Berger
@djberg96
Feb 08 2018 17:23
eh, if we're gonna break it, may as well go all the way
ps(pid: 1234, smaps: false)
Keenan Brock
@kbrock
Feb 08 2018 17:24
ooh - that is nice
Chris Arcand
@chrisarcand
Feb 08 2018 17:25
@kbrock O_O WAT. You're ok with removing the 'position' out of positional arguments like that?
Daniel Berger
@djberg96
Feb 08 2018 17:25
eh, i understand what he's doing to try to maintain backwards compatibility, but i'd rather just change it
Chris Arcand
@chrisarcand
Feb 08 2018 17:26
:+1: I agree, for my 2c :)
Daniel Berger
@djberg96
Feb 08 2018 17:26
as the opts hash as a second arg will bust the windows version anyway
so on windows it would change to ps(pid: 1234, host: some_host)
Nick LaMuro
@NickLaMuro
Feb 08 2018 17:27
oh, I didn't realize we had an issue with windows
Daniel Berger
@djberg96
Feb 08 2018 17:27
surprise! (not surprised)
Nick LaMuro
@NickLaMuro
Feb 08 2018 17:27
well yeah... it's your project
Daniel Berger
@djberg96
Feb 08 2018 17:28
yeah, on windows it's using wmi behind the scenes, which allows you to collect process data from other hosts
alright, i'll start another branch at some point (call it "kwargs"), and you can make future PR's against that branch
Daniel Berger
@djberg96
Feb 08 2018 17:42
(updated, added a command decision - dropping HP-UX support)
Nick LaMuro
@NickLaMuro
Feb 08 2018 17:44
seems reasonable
Daniel Berger
@djberg96
Feb 08 2018 17:47
I'm not even sure recent versions of Ruby will build on HP-UX