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
{ | |
"family": "cloud-bootstrap", | |
"executionRoleArn": "${TASK_EXEC_ROLE_ARN}", | |
"networkMode": "awsvpc", | |
"cpu": "1024", | |
"memory": "2048", | |
"requiresCompatibilities": [ | |
"FARGATE" | |
], | |
"containerDefinitions": [ |
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
version: 0.0 | |
Resources: | |
- TargetService: | |
Type: AWS::ECS::Service | |
Properties: | |
TaskDefinition: <TASK_DEFINITION> | |
LoadBalancerInfo: | |
ContainerName: "cloud-bootstrap" | |
ContainerPort: 8080 |
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
version: 0.2 | |
runtime-versions: | |
java: openjdk8 | |
phases: | |
install: | |
runtime-versions: | |
docker: 18 | |
pre_build: | |
commands: | |
- echo Logging in to Amazon ECR... |
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
spring: | |
application: | |
name: kafka-telemetry-data-consumer | |
# Ignore type headers in kafka message | |
kafka.properties.spring.json.use.type.headers: false | |
cloud: | |
stream: | |
kafka: | |
binder: | |
brokers: "localhost:29092" |
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 com.example.kafkasamplesstreams | |
import com.example.kafkasamplesstreams.events.AggregatedTelemetryData | |
import com.example.kafkasamplesstreams.events.SpaceAgency | |
import com.example.kafkasamplesstreams.events.TelemetryDataPoint | |
import com.example.kafkasamplesstreams.serdes.AggregateTelemetryDataSerde | |
import mu.KotlinLogging | |
import org.apache.kafka.common.serialization.Serdes | |
import org.apache.kafka.streams.kstream.KStream | |
import org.apache.kafka.streams.kstream.Materialized |
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
spring: | |
kafka.properties.spring.json.use.type.headers: false | |
application: | |
name: kafka-telemetry-data-aggregator | |
cloud: | |
function: | |
definition: aggregateTelemetryData | |
stream: | |
bindings: | |
aggregateTelemetryData-in-0: |
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 de.codecentric.samples.kafkasamplesproducer | |
import de.codecentric.samples.kafkasamplesproducer.event.TelemetryData | |
import mu.KotlinLogging | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.cloud.stream.function.StreamBridge | |
import org.springframework.kafka.support.KafkaHeaders | |
import org.springframework.messaging.support.MessageBuilder | |
import org.springframework.stereotype.Component |
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
spring: | |
application: | |
name: kafka-telemetry-data-producer | |
cloud: | |
stream: | |
kafka: | |
binder: | |
brokers: "localhost:29092" | |
bindings: | |
telemetry-data-out-0: |
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
import matplotlib.pyplot as plt | |
def read_file(): | |
with open("response-times-records.txt") as f: | |
# This assumes that lines are formatted like so: | |
# 42.123456|2021-07-01 12:00:00.000000 | |
return [line.rstrip().split("|") for line in f] | |
def plot_response_times(): | |
records = read_file() |
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
import json | |
import urllib.parse | |
import boto3 | |
import requests | |
import time | |
import datetime | |
ALBUM_ID = "REPLACE_ME_ALBUM_ID" | |
S3_BUCKET = "REPLACE_ME_BUCKET_NAME" | |
S3_KEY = "REPLACE_ME_BUCKET_OBJECT_NAME" |
NewerOlder