Create the pod on the cluster
kubectl apply -f nginx-pod.yaml
DROP INDEX IF EXISTS transfers_in, transfers_out; | |
CREATE INDEX transfers_in ON transfers (target_account_id); | |
CREATE INDEX transfers_out ON transfers (source_account_id); |
class Dog | |
def name | |
# retorna variável de instância | |
@name | |
end | |
end | |
doguinho = Dog.new | |
# Chamando método de instância |
require 'socket' | |
require 'cgi' | |
PORT = 3000 | |
socket = TCPServer.new('0.0.0.0', PORT) | |
puts "Listening to the port #{PORT}..." | |
loop do | |
# Wait for a new TCP connection..." |
class Cractor | |
def initialize(*args, &block) | |
@inbox = Queue.new | |
@outbox = Queue.new | |
Thread.new do | |
result = yield(self, *args) | |
self.yield(result) | |
end |
/* | |
Reverse a word | |
*/ | |
const reverse = (word) => { | |
const letters = word.split('') | |
const lastIdx = letters.length - 1 | |
return letters | |
.map((letter, idx) => { return letters[lastIdx - idx] }) | |
.join('') |
ab -n 20 -c 5 | |
Req per seconds Time per req (ms) | |
Threads – IO 232 21 | |
Fibers – IO 450 11 | |
Threads – External Req 1.85 2703 | |
Fibers – External Req 7.97 627 |
require 'faker' | |
require 'benchmark' | |
def generate_groups | |
(1..1_000).map do |id| | |
{ id: id, name: Faker::Educator.primary_school } | |
end | |
end | |
def generate_users(groups_ids) |
require 'benchmark' | |
def sum_range_using_for_loop(min, max) | |
range = (min..max) | |
sum = 0 | |
for n in range | |
sum = sum + n | |
end |
kubectl apply -f nginx-pod.yaml
config: | |
gcp:project: "my-project-created-on-gcp" |