These are chat archives for ManageIQ/manageiq/performance

15th
Feb 2018
Beni Cherniavsky-Paskin
@cben
Feb 15 2018 13:15
Fedora 27 can show color emoji in terminal. Alas, irc.gitter.im gateway doesn't translate :sparkles: :sparkles: to unicode ✨
bah, irc.gitter.im doesn't echo lines I type in browser, so above line didn't work as a test :frowning: 🤬. can someone please copy it back?
Ari Zellner
@zeari
Feb 15 2018 13:50
@cben
Fedora 27 can show color emoji in terminal. Alas, irc.gitter.im gateway doesn't translate :sparkles: :sparkles: to unicode ✨
Keenan Brock
@kbrock
Feb 15 2018 14:59
neat - the 2 sparkles show differently on my screen (just a little. one has more red highlights)
Beni Cherniavsky-Paskin
@cben
Feb 15 2018 15:56
opened gitterHQ/irc-bridge#101.
(I don't normally use the irc.gitter.com, nor terminal IRC clients, just wanted to check if going all :neckbeard: conflicts with viewing Allen's emoji ;–)
Jason Frey
@Fryguy
Feb 15 2018 19:45
@cben I think that's because the emojis are completely client side...when transmitted it's just whatever the user typed, but the UI gsub's it on the fly
unless you send a literal Unicode character like ❤️ as opposed to :heart:
Nick LaMuro
@NickLaMuro
Feb 15 2018 19:46
if you inspect the HTML, you will see one of those is a char, and the other is a <img/>
Jason Frey
@Fryguy
Feb 15 2018 19:46
:+1:... I mean 👍
Nick LaMuro
@NickLaMuro
Feb 15 2018 19:47
also, emojis in the terminal make me grumpy...
Joe Rafaniello
@jrafanie
Feb 15 2018 20:40
Where's Chris with his grumpy NickL image
Nick LaMuro
@NickLaMuro
Feb 15 2018 21:14
kick_or_ban.jpg
@jrafanie I will humor you
Joe Rafaniello
@jrafanie
Feb 15 2018 21:25
Who needs grumpy cat
Keenan Brock
@kbrock
Feb 15 2018 21:48

@chrisarcand from your metrics exploration, is there a way to access just one of our metrics shard tables instead of all of them?

We currently purge metrics using:

Metric.where(:id => Metric.where('timestamp < ?', 4.hours.ago)).delete_all
DELETE FROM "metrics"
WHERE "metrics"."id" IN (
   SELECT  "metrics"."id"
   FROM "metrics"
   WHERE ("metrics"."timestamp" <= '2018-02-01 19:56:37.519979')
   LIMIT 100
);

Unfortunatly expands to 24 deletes, with ~25 subqueries each --> ~600 queries in total

Was wondering if there is a way to construct sql that will target just one of the tables e.g.: metrics_03

Daniel Berger
@djberg96
Feb 15 2018 23:47
@kbrock Does this work? Metric.where("timestamp < ?", 4.hours.ago).in_batches(of: 100).delete_all
Keenan Brock
@kbrock
Feb 15 2018 23:49
@djberg96 looks like that "works" but...
that brings back 100 ids to ruby, then sends them back to the server
and out problem is the delete from "metrics" is a parent table of 24 tables, so it deletes from each of them
and the select id limit 100 sends that query to 24 tables and brings them back

If I can change the query to

DELETE FROM "metrics_21"
WHERE "metrics_21"."id" IN (
   SELECT  "metrics_21"."id"
   FROM "metrics_21"
   WHERE ("metrics_21"."timestamp" <= '2018-02-01 19:56:37.519979')
   LIMIT 100
);

then I get a big win. even if I have to run that one 24 times

Nick LaMuro
@NickLaMuro
Feb 15 2018 23:58
:raised_hand: Question: Where does the "~25 subqueries each" come from?
Keenan Brock
@kbrock
Feb 15 2018 23:59
@NickLaMuro IKR - well, 24 would make sense, since there are 24 hours in the day. but it seems to also query the parent table too, so that is 25