This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"context": { | |
"operation": { | |
"ops_no": 1 | |
} | |
}, | |
"message": { | |
"entity": { | |
"address_of_authorised_signatory": "LP", | |
"callback_url": "/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- From here the AOP dependencies start–>--> | |
<dependency> | |
<groupId>com.jcabi</groupId> | |
<artifactId>jcabi-aspects</artifactId> | |
<version>0.22.6</version> | |
</dependency> | |
<dependency> | |
<groupId>org.aspectj</groupId> | |
<artifactId>aspectjrt</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example; | |
import org.aspectj.lang.ProceedingJoinPoint; | |
import org.aspectj.lang.annotation.Around; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.aspectj.lang.reflect.MethodSignature; | |
import java.lang.reflect.Method; | |
@Aspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example; | |
public class NoobDeveloperCode { | |
public void f1() { | |
long startTime = System.currentTimeMillis(); | |
// This is the code that we want to measure | |
System.out.println("I am doing some basic tasks"); | |
// The code ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir dependencies | |
#Download all required dependencies | |
python3 -m pip install -t dependencies/python/lib/python3.7/site-packages selenium==3.8.0 | |
curl -SL https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip > dependencies/chromedriver.zip | |
curl -SL https://github.com/adieuadieu/serverless-chrome/releases/download/v1.0.0-41/stable-headless-chromium-amazonlinux-2017-03.zip > dependencies/headless-chromium.zip | |
unzip dependencies/chromedriver.zip -d dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
def lambda_handler(event, context): | |
options = Options() | |
options.binary_location = '/opt/headless-chromium' | |
options.add_argument('--headless') | |
options.add_argument('--no-sandbox') | |
options.add_argument('--single-process') | |
options.add_argument('--disable-dev-shm-usage') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BasicApp { | |
public static void main(String[] args) { | |
long l = System.currentTimeMillis(); | |
for (int i = 0; i < 100_000_000; i++) { | |
} | |
long l2 = System.currentTimeMillis(); | |
System.out.println("Time(in millis) taken to run empty for-loop, 1 Billion iterations - " + (l2 - l)); | |
System.out.println("File end Reached"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void runVirtual() throws Exception { | |
for (; ; ) { | |
long start = System.currentTimeMillis(); | |
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) { | |
for (int i = 0; i < 100_000_0; i++) { | |
executor.submit(() -> { | |
callExternalService(); | |
return null; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void runConventional() throws Exception { | |
for (; ; ) { | |
long start = System.currentTimeMillis(); | |
try (var executor = Executors.newFixedThreadPool(1000)) { | |
for (int i = 0; i < 100_000_0; i++) { | |
executor.submit(() -> { | |
callExternalService(); | |
return null; | |
}); | |
} |