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
terraform { | |
required_providers { | |
warpstream = { | |
source = "warpstreamlabs/warpstream" | |
} | |
kafka = { | |
source = "Mongey/kafka" | |
} | |
} | |
} |
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
package pool | |
import ( | |
"fmt" | |
"sync" | |
"runtime" | |
) | |
// GoroutinePool pools Goroutines to avoid performance penalties associated with spawning many | |
// short-lived goroutines that each have to individually grow their stack. |
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
const prometheus = require('prom-client'); | |
const winston = require('winston'); | |
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const logTransports = { | |
console: new winston.transports.Console({ level: 'info' }), | |
// Could also configure logging to a file at a different level here. |
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
// Copyright (c) 2016 Uber Technologies, Inc | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
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
module.exports = { | |
networks: { | |
kovan: { | |
host: "localhost", | |
port: 8545, | |
network_id: "*", | |
gas: 4700000 | |
} | |
} | |
}; |
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
var SingleMessage = artifacts.require('../contracts/SingleMessage.sol'); | |
module.exports = function(deployer, network, accounts) { | |
return liveDeploy(deployer, accounts); | |
}; | |
async function liveDeploy(deployer, accounts) { | |
const initialMessage = "Hello world!"; | |
const initialPriceInWei = 1; | |
const maxLength = 200; |
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
var Migrations = artifacts.require("./Migrations.sol"); | |
module.exports = function(deployer) { | |
deployer.deploy(Migrations); | |
}; |
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
var SingleMessage = artifacts.require("SingleMessage"); | |
contract("SingleMessage", function(accounts) { | |
const initialMessage = "hello world!"; | |
const initialPrice = 10; | |
const maxLength = 200; | |
beforeEach(async function() { | |
this.contract = await SingleMessage.new(initialMessage, initialPrice, maxLength); | |
}); |
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
contract SingleMessage is Ownable { | |
string public message; | |
uint256 public priceInWei; | |
uint256 public maxLength; | |
event MessageSet(string message, uint256 priceInWei, uint256 newPriceInWei, address payer); | |
function SingleMessage(string initialMessage, uint256 initialPriceInWei, uint256 maxLengthArg) public { | |
message = initialMessage; | |
priceInWei = initialPriceInWei; |
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
hyperdash_free=> explain analyze SELECT sdk_run_uuid FROM heartbeats WHERE last_seen_at < NOW() - INTERVAL '30 seconds' AND eligible_for_disconnect_scan = true AND run_completed = false LIMIT 10; | |
QUERY PLAN | |
----------------------------------------------------------------------------------------------------------------------------------------------------------- | |
Limit (cost=0.43..2.64 rows=10 width=16) (actual time=191.810..191.810 rows=0 loops=1) | |
-> Index Scan using heartbeats_last_seen_at_idx on heartbeats (cost=0.43..15066.99 rows=68307 width=16) (actual time=191.809..191.809 rows=0 loops=1) | |
Index Cond: (last_seen_at < (now() - '00:00:30'::interval)) | |
Planning time: 0.089 ms | |
Execution time: 191.837 ms | |
(5 rows) |
NewerOlder