opendev.hashnode.devCloudwatch Insights Basic - 1In this article, I am introduction query and search cloudwatch insights basic. APIGW statistical according api key id fields @timestamp, @message | filter @message like /API Key ID/ | parse @message "API Key ID: *" as @apikeyid | stats count(*) by ...Jan 1, 2024·2 min read
opendev.hashnode.devGolang Producer and Consumer with Kafka Simpleinstall package: go get https://github.com/segmentio/kafka-go Create Topic In Kafka: create topic name logging topic logging has 1 partition Producer create folder producer: create file main.go in folder producer copy and paste code: package...Jun 11, 2023·2 min read
opendev.hashnode.dev[Golang] Test Performance - 2Comparing the Check If-Else String package main import ( "strings" "testing" ) func CheckIfElseEmpty(s string) string { if s == "sdfsdsdfsdsdfsdsdfsdsdfsdsdfsd" { return s } return s } func CheckIfElseLen(s string) strin...Feb 19, 2023·1 min read
opendev.hashnode.dev[Golang] Test Performance Function Standard - 1Comparing performance return error create file return.go func newErr() error { return errors.new("this is error") } func fmtErr() error { return fmt.Errorf("this is error") } create file return_test.go func BenchmarkNewErr(b *testing.B) ...Dec 15, 2022·2 min read
opendev.hashnode.dev[Golang] Use Redis implement attempt access in periodCode example: connect redis: func InitRedis() *redis.Client { rdb := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // no password set DB: 0, // use default DB }) return rdb } mai...Dec 10, 2022·1 min read