small experiment on our go meetup.
This file contains hidden or 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
| package main | |
| import ( | |
| "log" | |
| "time" | |
| "github.com/go-pg/pg" | |
| ) | |
| const maxWorkers = 5 |
This file contains hidden or 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
| hidden text FILENAME | |
| counter log_ftp_files_processed_count by username, remote_host, transfer_type, direction | |
| counter log_ftp_files_deleted_count by username, remote_host, transfer_type | |
| counter log_ftp_files_incomplete_transfers_count by username, remote_host, transfer_type | |
| FILENAME = getfilename() | |
| ## example file | |
| ### Fri Jan 4 12:55:27 2019 1 1.2.3.4 224 /path/to/file.CSV b _ o r user_name ftp 0 * c |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type contrato interface { | |
| Insert() string | |
| } |
This file contains hidden or 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
| version: '3.1' | |
| volumes: | |
| prometheus_data: {} | |
| grafana_data: {} | |
| services: | |
| prometheus: | |
| image: prom/prometheus | |
| volumes: |
This file contains hidden or 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
| -- tuning used: https://www.pgconfig.org/#/tuning?total_ram=10&max_connections=100&environment_name=WEB&pg_version=10&os_type=Unix&arch=x86-64&drive_type=SSD&share_link=true | |
| -- mbp pro 15", 500gb ssd, 16gb ram, i7 2,9ghz processor | |
| \timing on | |
| \pset null ~ | |
| \set max_rows 1000 | |
| DROP TABLE IF EXISTS load_test; | |
| create table load_test (id serial primary key, name text, birth_date date, age int); |
This file contains hidden or 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
| # select pg_xlog_location_diff('951A/EA0F8000', '9518/1ECB6000'); | |
| # super_db=# select pg_xlog_location_diff('951A/EA0F8000', '9518/1ECB6000'); | |
| # pg_xlog_location_diff | |
| # ----------------------- | |
| # 12000174080 | |
| # (1 row) | |
| # super_db=# select pg_xlogfile_name('951A/EA0F8000'), pg_xlogfile_name('9518/1ECB6000'); | |
| # -[ RECORD 1 ]----+------------------------- | |
| # pg_xlogfile_name | 000000030000951A000000EA |
This file contains hidden or 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
| --- | |
| - hosts: localhost | |
| connection: local | |
| vars: | |
| gather_facts: False | |
| vars: | |
| keypair: "my-keypair-name" | |
| instance_type: m4.large | |
| security_group: | |
| - "vpc-group-1" |
This file contains hidden or 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
| sebastian=# create schema esquema_a; | |
| CREATE SCHEMA | |
| sebastian=# create schema esquema_b; | |
| CREATE SCHEMA | |
| sebastian=# create schema esquema_c; | |
| CREATE SCHEMA | |
| sebastian=# create schema esquema_d; | |
| CREATE SCHEMA | |
| sebastian=# create schema esquema_e; | |
| CREATE SCHEMA |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/xenial64" | |
| $script = <<SCRIPT | |
| sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -c | awk '{print $2}')-pgdg main" > /etc/apt/sources.list.d/pgdg.list |
