Skip to content

Instantly share code, notes, and snippets.

🎯
Kubernetes & FaaS

Ta-Ching Chen life1347

🎯
Kubernetes & FaaS
Block or report user

Report or block life1347

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@life1347
life1347 / gomaps.go
Created Aug 24, 2018 — forked from craigmj/gomaps.go
Performance testing of goroutine vs sync map implementation in Go.
View gomaps.go
package main
import (
"fmt"
"math/rand"
"runtime"
"strconv"
"sync"
"time"
)
View gist:c383decdfc077b83e14a988c83bf44e1
# Create mq trigger
$ fission mqt create --name mqt-test --function <function name> --topic <topic-name>
# Check wether nats-streaming server create a channel to receive message
$ kubectl -n fission logs -f <nats-streaming pod>
[1] 2018/08/27 06:19:00.989160 [INF] STREAM: Starting nats-streaming-server[fissionMQTrigger] version 0.10.2
[1] 2018/08/27 06:19:00.989192 [INF] STREAM: ServerID: qYfsXq0SHJ6ud9madIckpq
[1] 2018/08/27 06:19:00.989195 [INF] STREAM: Go version: go1.10.3
[1] 2018/08/27 06:19:00.989636 [INF] Starting nats-server version 1.1.0
[1] 2018/08/27 06:19:00.989855 [INF] Git commit [not set]
View gist:fe79903dcad9673d8045ca24fccf5102
$ go run ./p7uGl0JZ_TR.go
NoEmbedStruct
without pool: 1.558109ms
with pool: 89.337184ms
EmbedStruct
without pool: 651.618531ms
with pool: 84.505615ms
# https://stackoverflow.com/questions/45003259/passing-an-optimization-flag-to-a-go-compiler
View Fission Swagger API
{
"swagger": "2.0",
"info": {
"description": "\nOpenAPI 2.0 document for fission controller\n* Metadata (v1.ObjectMeta) should be empty when creating a CRD resource. Kubernetes will assign it automatically.\n* Following semantic errors are known issues and won't affect the API access.\n - Operations must have unique operationIds.\n - All scale semantic errors. (Due to go-restful exposes inner fields of k8s struct).\n",
"title": "Fission OpenAPI 2.0",
"version": "v1"
},
"paths": {
"/proxy/storage/v1/archive": {
"get": {
@life1347
life1347 / benchmark.go
Last active Aug 21, 2019
Logrus v.s Zap
View benchmark.go
package main
import (
"encoding/json"
"fmt"
"log"
"time"
logrus "github.com/Sirupsen/logrus"
zap "go.uber.org/zap"
You can’t perform that action at this time.