This file contains hidden or 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
Chart | Sample PromQL Query | |
Total Requests | sum(rate(http_server_requests_seconds_count[1m])) | |
Total Exceptions | sum(rate(http_server_requests_seconds_count{exception!="None"}[1m])) | |
2xx Requests % | sum(rate(http_server_requests_seconds_count{status=~"2.."}[1m])) / sum(rate(http_server_requests_seconds_count[1m])) * 100 | |
5xx Requests % | sum(rate(http_server_requests_seconds_count{status=~"5.."}[1m])) / sum(rate(http_server_requests_seconds_count[1m])) * 100 | |
Request Duration | histogram_quantile(0.95, sum(rate(http_server_requests_seconds_bucket[5m])) by (le, uri)) | |
Requests Per Path | sum(rate(http_server_requests_seconds_count[1m])) by (uri) |
This file contains hidden or 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 com.example.app; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} |
This file contains hidden or 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
import java.io.*; | |
import java.nio.file.*; | |
import java.util.*; | |
public class PlaceholderRenderer { | |
public static void main(String[] args) throws IOException { | |
if (args.length < 3) { | |
System.err.println("Usage: PlaceholderRenderer <confFile> <inputDir> <outputDir>"); | |
return; |
This file contains hidden or 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
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.springframework.web.reactive.function.client.WebClient; | |
import java.util.*; | |
public class AzureSearchUploader { | |
private static final String SEARCH_ENDPOINT = "https://<your-search>.search.windows.net"; | |
private static final String API_KEY = "<your-api-key>"; | |
private static final String INDEX_NAME = "<your-index-name>"; |
This file contains hidden or 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
@Bean | |
public HttpComponentsMessageSender httpComponentsMessageSender() throws Exception { | |
// Create an SSLContext that trusts all certificates | |
SSLContext sslContext = new SSLContextBuilder() | |
.loadTrustMaterial(null, (certificate, authType) -> true) | |
.build(); | |
// Create an HttpClient that uses the custom SSLContext and disables hostname verification | |
CloseableHttpClient httpClient = HttpClients.custom() | |
.setSSLContext(sslContext) |
This file contains hidden or 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
\\\<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | |
http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example</groupId> | |
<artifactId>my-maven-project</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>pom</packaging> |
This file contains hidden or 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
import io.micronaut.http.annotation.Controller; | |
import io.micronaut.http.annotation.Get; | |
import io.micronaut.security.annotation.Secured; | |
import io.micronaut.security.rules.SecurityRule; | |
import io.micronaut.security.authentication.Authentication; | |
@Controller("/api") | |
public class ApiController { | |
@Get("/user") |
This file contains hidden or 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 com.example.app.cucumber.stepdefs; | |
import io.cucumber.java.en.Given; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.client.RestTemplate; | |
import org.springframework.http.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class CommonSteps { |
This file contains hidden or 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
import com.opencsv.bean.CsvToBean; | |
import com.opencsv.bean.CsvToBeanBuilder; | |
import java.io.FileReader; | |
import java.io.Reader; | |
import java.util.List; | |
public class CsvReaderService { | |
public static List<Person> readCsv(String filePath) { | |
try (Reader reader = new FileReader(filePath)) { | |
CsvToBean<Person> csvToBean = new CsvToBeanBuilder<Person>(reader) |
This file contains hidden or 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
$env:AZURE_STORAGE_CONNECTION_STRING = "<your_connection_string>" | |
az storage blob upload --container-name my-container --name myfile.txt --file "C:\path\to\myfile.txt" |
NewerOlder