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
calculateSubscriberVideoPanelElement(stream: any, isMemberStream: boolean) { | |
const { callModel, cameraModel, medium, isSupervisor } = this.props; | |
if (isNil(stream)) { | |
if (isMemberStream) { | |
if (callModel && callModel.sirenEndTime) { | |
return <SirenCounter callModel={callModel} withTokboxWrapper={true} />; | |
} else { | |
return <NoVideo medium={medium} cameraModel={cameraModel} />; | |
} | |
} else { |
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
#!/usr/bin/env bash | |
pod=$1 | |
scheduled=`kubectl get pod $pod -o json | jq -r '.status.conditions[] | select(.type=="PodScheduled") | .lastTransitionTime' | sed 's/T/ /g' | tr -d 'Z'` | |
ready=`kubectl get pod $pod -o json | jq -r '.status.conditions[] | select(.type=="Ready") | .lastTransitionTime' | sed 's/T/ /g' | tr -d 'Z'` | |
scheduled_epoch=`date -j -u -f "%Y-%m-%d %T" "$scheduled" "+%s"` # mac os date ( linux has different | |
echo "${pod} sechedualed at ${scheduled_epoch}" | |
ready_epoch=`date -j -u -f "%Y-%m-%d %T" "$ready" "+%s"` | |
load_seconds=$((ready_epoch-scheduled_epoch)) | |
echo "${pod} launch time: ${load_seconds} seconds" |
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 io.vertx.core.Vertx | |
import io.vertx.ext.web.Router | |
import java.time.Instant.now | |
import kotlin.math.pow | |
fun main() { | |
println("starting application ${now().epochSecond}") | |
val now = now() | |
val cores = Runtime.getRuntime().availableProcessors() | |
val ram = Runtime.getRuntime().maxMemory().toDouble() |
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
#deployment.yaml | |
resources: | |
limits: | |
memory: "256Mi" | |
cpu: "500" | |
requests: | |
memory: "256Mi" | |
cpu: "150m" | |
... | |
livenessProbe: |
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
kubectl get --raw /apis/metrics.k8s.io/v1beta1/namespaces/${NAMESPACE_NAME}/pods/${POD_NAME} | jq . | |
{ | |
"kind": "PodMetrics", | |
"apiVersion": "metrics.k8s.io/v1beta1", | |
"metadata": { | |
"name": "PODNAME", | |
"namespace": "NAMESPACE", | |
"selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/NAMESPACE/pods/PODNAME", | |
"creationTimestamp": "2020-04-15T10:53:04Z" | |
}, |
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
# pod schedualed event timestamp | |
kubectl get pod $pod -o json | jq -r '.status.conditions[] | select(.type=="PodScheduled") | .lastTransitionTime |
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
class BananaApi { | |
fun getBanana(id: String): Banana { | |
return Banana(Color.GREEN, 0.5, id) | |
} | |
fun deleteBanana(id: String) { | |
println("delete banana with id $id") | |
} |
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
class BananaService { | |
fun getBanana(id: String): Banana { | |
return Banana(Color.YELLOW, 0.5, id) | |
} | |
fun createBanana(banana: CreateBanana) : Banana { | |
return Banana(Color.GREEN, 0.5, "random id") | |
} | |
} | |
data class Banana(val color: Color, |
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
service Banana { | |
rpc GetBanana (GetBananaRequest) returns (BananaResponse) {} | |
rpc CreateBanana (CreateBananaRequest) returns (BananaResponse) {} | |
} | |
message GetBananaRequest { | |
string id = 1; | |
} | |
message BananaResponse { |
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 "google/api/annotations.proto"; | |
service Banana { | |
rpc CreateBanana (CreateBananaRequest) returns (BananaResponse) { | |
option (google.api.http) = { | |
post: "/v1/example/echo" | |
body: "*" | |
}; | |
} |
OlderNewer