Skip to content

Instantly share code, notes, and snippets.

@diegolovison
diegolovison / processes-swapped.sh
Created November 14, 2019 11:39
Below is the script obtained from http://stackoverflow.com/questions/479953/how-to-find-out-which-processes-are-swapping-in-linux (thanks to the author) that, when executed, will show all the processes that are being swapped
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
# Modified by Mikko Rantalainen 2012-08-09
# Pipe the output to "sort -nk3" to get sorted output
# Modified by Marc Methot 2014-09-18
# removed the need for sudo
SUM=0
OVERALL=0
@diegolovison
diegolovison / ispn.hf.yaml
Created January 6, 2020 10:40
ispn.hf.yaml
name: ispn
http:
host: http://127.0.0.1:11223
phases:
- example:
atOnce:
users: 10
scenario:
- test:
- randomInt: cacheId <- 1 .. 999
[hudson@edg-perf01 ~]$ ls -l perf.data
-rw-------. 1 hudson hudson 303476 Jan 8 08:19 perf.data
[hudson@edg-perf01 ~]$ perf script --header > perf.data.log
Failed to open /tmp/perf-16853.map, continuing without symbols
[hudson@edg-perf01 ~]$
package org.jboss.arquillian.junit.container;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.jboss.arquillian.container.test.spi.TestRunner;
import org.jboss.arquillian.junit.State;
import org.jboss.arquillian.test.spi.TestResult;
import org.junit.Test;
import org.junit.Test.None;
@diegolovison
diegolovison / scalability_test.py
Created May 20, 2020 19:37
Scalability Tests Prediction from RadarGun Benchmark
import pandas as pd
from datetime import datetime
import numpy as np
# https://github.com/wip727/PyUSL/issues/1
from usl_v2 import usl_v2
def _append(node, max_index, row):
sum_value = 0
l = reversed(range(max_index + 1))
Required softwares:
* Vagrant
* docker-machine
* virtualbox
Create a file: `Vagrantfile`
```
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "private_network", ip: "192.168.33.10"
@diegolovison
diegolovison / install-hsdis-amd64.md
Last active January 22, 2021 14:01
Could not load hsdis-amd64.dylib; PrintAssembly is disabled; OSX
mkdir tmp
cd tmp
git clone https://github.com/AdoptOpenJDK/openjdk-jdk11u.git
cd openjdk-jdk11u/src/utils/hsdis/
wget http://ftp.heanet.ie/mirrors/ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.gz
tar -xzf binutils-2.31.1.tar.gz 
make BINUTILS=binutils-2.31.1 ARCH=amd64
cp build/macosx-amd64/hsdis-amd64.dylib $JAVA_HOME/lib/server/
@diegolovison
diegolovison / log4j2.xml
Last active July 20, 2022 01:37
how create filters for log4j2
<?xml version="1.0" encoding="UTF-8"?>
<Configuration name="InfinispanServerConfig" monitorInterval="60" shutdownHook="disable">
<Properties>
<Property name="path">${sys:infinispan.server.log.path}</Property>
<Property name="accessLogPattern">%X{address} %X{user} [%d{dd/MMM/yyyy:HH:mm:ss Z}] &quot;%X{method} %m %X{protocol}&quot; %X{status} %X{requestSize} %X{responseSize} %X{duration}%n</Property>
</Properties>
<Appenders>
<!-- Colored output on the console -->
<Console name="STDOUT">
<PatternLayout pattern="%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p (%t) [%c] %m%throwable}{INFO=normal, DEBUG=normal, TRACE=normal}%n"/>
@diegolovison
diegolovison / retrieve_openshift_registry.sh
Created March 1, 2022 03:45
How retrieve OpenShift registry
oc login ...
OC_USER=$(oc whoami)
oc project openshift-image-registry
oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
oc policy add-role-to-user registry-viewer $OC_USER
oc policy add-role-to-user registry-editor $OC_USER
REGISTRY_HOST=$(oc get route default-route --template='{{ .spec.host }}')
echo $REGISTRY_HOST
@diegolovison
diegolovison / basic-operations-test-different-values.xml
Created June 24, 2022 16:51
RadarGun different attribute value for basic-operations-test
<benchmark xmlns="urn:radargun:benchmark:3.0">
<main bindAddress="${main.address:127.0.0.1}" port="${main.port:2103}"/>
<clusters>
<scale from="1" to="1">
<cluster />
</scale>
</clusters>
<configurations>
<config name="dist-1">