Skip to content

Instantly share code, notes, and snippets.

View fgonzal's full-sized avatar

Federico González fgonzal

View GitHub Profile
@fgonzal
fgonzal / gist:04a01e8fea84521bc5492c92eb5f85db
Created October 9, 2020 20:22
TSpace implementation consuming too much CPU
Yesterday I had a conversation with a performance engineer from a large customer (Marqeta). He had concerns about the TSpace implementation consuming too much CPU. The TSpace is fast, and can perform some 4 Million TPSs on my laptop, so it’s never a concern in a production system, he still was comparing it with a general purpose blocking queue implementation.
His test was flawed, and he liked my explanation, which I want to share, because I think this issue will pop up again and again, from time to time.
```
When you test in a simulated environment, all sessions are idle, eagerly waiting for a new entry to process. So when the new entry hits the space, and the out operation performs a notify, all idle sessions wake-up and fight in the synchronized block to obtain that entry. This is unrealistic. If you have a 1000 TPS load, it’s not reasonable that all your 100 sessions are idle. Most of them will be processing the transaction. When they finish the transaction, just a few out of those 100 sessions will “figh

Values can be passed from one test the following using variables.

As an example, let's say we have a purchase and a reversal, and you want to use the purchase approval code in the reversal message.

Your purchase test would look something like this:

   <test file="auth" continue="no" 
         name="Card ok, account 00.858 auth for $40.00 GOOD">
 DATE=new Date();

Keybase proof

I hereby claim:

  • I am fgonzal on github.
  • I am fgonzal (https://keybase.io/fgonzal) on keybase.
  • I have a public key ASCm4iUIbb3k0fFCTBAnQoG5tsCqMqeDkjlOB6xLrQucLQo

To claim this, I am signing this object:

@fgonzal
fgonzal / update_jenkins.sh
Last active December 2, 2019 22:41
Bash script to update Jenkins on an Ubuntu host.
#!/bin/bash
sudo service jenkins stop
cd /usr/share/jenkins
sudo mv --force jenkins.war jenkins.war.old
sudo wget https://updates.jenkins-ci.org/latest/jenkins.war
sudo service jenkins start
echo "Jenkins has been successfully updated."
@fgonzal
fgonzal / gist:ebaaf15813c9164cebdc6f42e2b13ead
Created October 8, 2019 17:32
MacOS Error: "invalid active developer path (/Library/Developer/CommandLineTools))"
The following error shows up when the XCode command line is outdated:
```
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
```
To fix it, just do the following on a Terminal window:
```
xcode-select --install
@fgonzal
fgonzal / java-code-formatting.xml
Last active April 18, 2019 23:18
Eclipse Java formatting XML that can be used in VSCode.
<?xml version="1.0" encoding="UTF-8"?>
<profiles version="10">
<profile name="Spring" version="10">
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>