Timestamp Name ID When Generated
------------------------------------------------------------
Originate Timestamp T1 time request sent by client
Receive Timestamp T2 time request received by server
Transmit Timestamp T3 time reply sent by server
Destination Timestamp T4 time reply received by client
The roundtrip delay d and system clock offset t are defined as:
d = (T4 - T1) - (T3 - T2)
t = ((T2 - T1) + (T3 - T4)) / 2.
const arr = ["catboy", "cat", "catman"];
const filtStr = (str) => {
return arr.filter((item) => item === str);
};
console.log(filtStr("cat"));
Скрипт в 10 потоков работает постоянно и раз в сутки он пишет лог за новый день, но на новый день вылезает баг.
Каждый поток создаёт файл когда ему нужно записать что то в лог и таким образом файл пересоздается 10 раз и логи не сохраняются(
kubectl run -it some_unique_name --image youre/image:tag --restart=Never --rm -- /bin/bash
>>> current = [1,1]
>>> snake = []
>>> snake.append(current.copy())
>>>
>>> snake
[[1, 1]]
>>> current[1] += 1
>>>
>>> current
[1, 2]
>>> snake
[[1, 1]]
>>>
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-http-deployment
labels:
app: http-http
spec:
replicas: 1
selector:
matchLabels:
app: http-http
template:
metadata:
labels:
app: http-http
spec:
containers:
- name: http-http
image: stasbigunenko/http_http
env:
- name: PORT_HTTP
value: ":8085"
- name: GRPC
value: "grpc-service:9000"
ports:
- containerPort: 8085
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-grpc-deployment
labels:
app: http-grpc
spec:
replicas: 1
selector:
matchLabels:
app: http-grpc
template:
metadata:
labels:
app: http-grpc
spec:
containers:
- name: http-grpc
image: stasbigunenko/http_grpc
env:
- name: TCP_PORT
value: ":9000"
ports:
- containerPort: 9000
---
apiVersion: v1
kind: Service
metadata:
name: http-service
spec:
selector:
app: http-http
ports:
- protocol: TCP
port: 8085
---
apiVersion: v1
kind: Service
metadata:
name: grpc-service
spec:
selector:
app: http-grpc
ports:
- protocol: TCP
port: 9000
import requests
url = 'https://gitlab.com/api/v4/projects/123/repository/commits'
data = {"branch": "main", "commit_message": "create", "actions": [{"action": "create", "file_path": "1.json", "content": "test"}]}
headers={'PRIVATE-TOKEN': 'token'}
res = requests.post(url, headers=headers, json=data)