|
pointsofdata posted:There's a thing called Logical Correlation Context or something which works really well using some sort of magic request correlation ids are one of the best features of asp.net. also the magic is thread local storage (I think?)
|
# ? Nov 2, 2016 23:46 |
|
|
# ? May 25, 2024 23:26 |
|
latest nlog or older nlog + nlog contrib has support for correlation ids as a logging variable so you don't even need to do any extra work.
|
# ? Nov 2, 2016 23:47 |
|
we have been gifted with typed json to fix all of its issues lets celebrate https://tonyarcieri.com/introducing-tjson-a-stricter-typed-form-of-json
|
# ? Nov 3, 2016 00:10 |
|
oh should i be doing api logging different than just synchronously making GBS threads the request into the database?
|
# ? Nov 3, 2016 00:28 |
|
HoboMan posted:oh should i be doing api logging different than just synchronously making GBS threads the request into the database? Nah yiu do it the same but put async=true in your nlog config
|
# ? Nov 3, 2016 00:31 |
|
Shaggar posted:request correlation ids are one of the best features of asp.net. also the magic is thread local storage (I think?) Put it gets passed between threads started from abother somehow and always just works
|
# ? Nov 3, 2016 00:33 |
|
oh. its just in HttpRequestMessage.Properties . not much magic there
|
# ? Nov 3, 2016 01:01 |
|
necrotic posted:we have been gifted with typed json to fix all of its issues lets celebrate gross. if i hated myself id just use xml
|
# ? Nov 3, 2016 01:17 |
|
akadajet posted:gross. if i hated myself id just use xml why would you use something easy, pleasant, and fit for purpose if you hated yourself?
|
# ? Nov 3, 2016 02:00 |
|
Soricidus posted:why would you use something easy, pleasant, and fit for purpose if you hated yourself? https://www.youtube.com/watch?v=yfelqZpapZA&hd=1
|
# ? Nov 3, 2016 02:04 |
|
pointsofdata posted:Nah yiu do it the same but put async=true in your nlog config nlog?
|
# ? Nov 3, 2016 04:22 |
|
Luigi Thirty posted:so I have a VMWare virtual machine here hmm. on second thought maybe i don't want to hook up this amiga
|
# ? Nov 3, 2016 06:09 |
|
HoboMan posted:nlog? It's a logging framework there's ones for java too
|
# ? Nov 3, 2016 07:55 |
|
does that typed json seriously support float as it's ONLY decimal type?
|
# ? Nov 3, 2016 08:50 |
|
Condiv posted:does that typed json seriously support float as it's ONLY decimal type?
|
# ? Nov 3, 2016 08:55 |
|
JewKiller 3000 posted:pasting this here since only 1 person responded in the PL thread: I think No Starch Press has some good books for kids, about building games and such. Much more fun than Eloquent Javascript, which i would not recommend for a 14 year old. its way too dry and also probably too difficult for a first introduction.
|
# ? Nov 3, 2016 09:42 |
|
Condiv posted:does that typed json seriously support float as it's ONLY decimal type? well its the typed javascript object serialization format and javascript only has floats
|
# ? Nov 3, 2016 15:18 |
|
necrotic posted:well its the typed javascript object serialization format and javascript only has floats this. javascript has nothing more precise than floats. if you deal with monetary stuff, for example, you really need to be disciplined about making sure your JS's only job is to accept the user-entered values and then ship them to something written in a less garbo language to do the actual math on them.
|
# ? Nov 3, 2016 16:34 |
|
i thought javascript only had doubles?
|
# ? Nov 3, 2016 16:42 |
|
fritz posted:i thought javascript only had doubles?
|
# ? Nov 3, 2016 16:55 |
|
Condiv posted:does that typed json seriously support float as it's ONLY decimal type? if you need anything else you just put it in there as a string, duh
|
# ? Nov 3, 2016 17:03 |
|
fritz posted:i thought javascript only had doubles? javascript has strings and then different interpretations on strings. that's it
|
# ? Nov 3, 2016 17:26 |
|
What's that devs you think we're going to miss the deadline? Here's another feature that has no service or ui that is due in 8.5 working days
|
# ? Nov 3, 2016 18:04 |
|
Corla Plankun posted:why doesnt null equal null in psql null isn't a value, it's the absence of a value in sql at least so, you'e not asking if it equals itself, you're asking if one missing piece of data is the same as another missing piece well, most of the time. sometimes in sql null does equal null when you're doing operations over the same column
|
# ? Nov 3, 2016 18:26 |
|
am i a stupid rear end in a top hat if my request logging mostly consists of shoveling the json request thats POSTed to my API into a postgres jsonb column
|
# ? Nov 3, 2016 19:46 |
|
its kind of gross since it limits your input formats to the api to json, but if you're only doing json then meh. the only thing is it makes it sound like you might be manually parsing json instead of using a formatter and normal model binding.
|
# ? Nov 3, 2016 19:58 |
|
i've got the normal model binding going in the controller, i suppose there's probably a way to bind the model in a handler thing? im making a DelegatingHandler and sticking it in my HttpConfiguration
|
# ? Nov 3, 2016 20:00 |
|
maybe i should be logging from the controller endpoint where the request content has more meaningful context. or maybe log from both the generic handler and the endpoint?
|
# ? Nov 3, 2016 20:02 |
|
Bloody posted:am i a stupid rear end in a top hat if my request logging mostly consists of shoveling the json request thats POSTed to my API into a postgres jsonb column it's what i do so probably
|
# ? Nov 3, 2016 20:04 |
|
I needed to make a temporary db branch in tfs since that's apparently the only way to attach a change script to a commit after the fact, but i named it tempDB_Because_Im_A_Dumb in the tfs foldermapping, is there a way to delete this folder? lol
|
# ? Nov 3, 2016 20:09 |
|
welp doing a few db inserts has absolutely ruined my application for some reason. was good at 2k requests per second with no db stuff, now some simple db logging is basically broken at 100 requests per second
|
# ? Nov 3, 2016 20:10 |
|
it looks something like: using(var conn = new NpgsqlConnection(connectionString)) { await conn.OpenAsync(); using(var query = new NpgsqlCommand()) { query.connection = conn; query.command = "insert blah"; query.parameters.addwithvalue("blah", blah, blah); await query.ExecuteNonQueryAsync(); } using(var query = new NpgsqlCommand()) { query.connection = conn; query.command = "insert blah"; query.parameters.addwithvalue("blah", blah, blah); await query.ExecuteNonQueryAsync(); } } and then under anything vaguely resembling a load it completely melts
|
# ? Nov 3, 2016 20:13 |
|
it seems like running two db inserts every time my controller gets hit is not ideal also doing parameterized multi-row inserts feels hacky? like my model is just an array of poo poo that im passed usually as a json array of poo poo and so i want to shove the whole thing in the db but i wanna do that reasonably quickly so i wanna do a multi-row insert so im doin like for(var i = 0; i < fart.length; i++) cmd += $(@foo{i}, @butt{i})," cmd = cmd.Substring(0, cmd.length-1); and just like mashing strings together and poo poo myself and then doing another loop to AddWithValue all of those parameters i just mashed into a string and like ??? idk i feel like this shouldnt require so much string janitoring? i like that half of the results i find for multi-row ado.net inserts are trivially vulnerable to sqli Bloody fucked around with this message at 20:45 on Nov 3, 2016 |
# ? Nov 3, 2016 20:40 |
|
Do the same but into an elasticsearch cluster
|
# ? Nov 3, 2016 21:04 |
|
"dev", "prod", and the "db cluster" are all local to my machine. there is no cloud. there is no vm. hail satan
|
# ? Nov 3, 2016 21:06 |
|
Bloody posted:it looks something like: is this configured to use a connection pool of some sort (doesn't look like it)? otherwise, yeah, a new DB connection every request is gonna limit you a lot.
|
# ? Nov 3, 2016 21:17 |
|
Bloody posted:welp doing a few db inserts has absolutely ruined my application for some reason. was good at 2k requests per second with no db stuff, now some simple db logging is basically broken at 100 requests per second How long does each request take? The connection creation is probably your biggest overhead if you've not got connection pooling going on, but 100 requests per second seems low even taking that into account.
|
# ? Nov 3, 2016 21:39 |
|
i dunno! how does npgsql connection pooling work? also i fudged together a bulk insert command and it is way faster than the non-bulk insert like 10x faster
|
# ? Nov 3, 2016 21:42 |
|
qntm posted:"poor culture fit" Looks like they translated this into a slightly more prosaic form: Recruiter posted:Thanks for following up and I wanted to circle back with you in regards to your previous email. Unfortunately due to HR policies, we cannot provide specific candidate feedback. Took my second application for an SRE position though, I seem to be missing the secret handshake to get a terrible programmer role. I'm starting to wonder about their SWE roles as they appear to have no logging or monitoring on anything in production and many questions were about inspecting what an app is doing at runtime.
|
# ? Nov 3, 2016 21:44 |
|
|
# ? May 25, 2024 23:26 |
|
I thought the sql connections got auto pooled or something? so even if you close the connection in code or dispose of it it actually gets retained in the background and reused or something. i read like one tutorial today and realised that i know nothing and am actually just stack overflowing myself to success
|
# ? Nov 3, 2016 21:44 |