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
Query tailQ = new Query().addCriteria(Criteria.where("ns").is("streams.user")); | |
reactiveMongoTemplate.tail(tailQ, OplogEntry.class, "oplog.rs") | |
.retryWhen(Retry.indefinitely().doAfterRetryAsync(signal -> Mono.delay(Duration.ofSeconds(10)).then())) | |
.subscribe(entry -> { | |
log.info("tailed entry: {}", entry); | |
lastOplogAt.set(entry.ts().getTime() * 1000L); | |
}); |
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
Gauge.builder("sync.last.seen.oplog.at", this, mongoStats -> mongoStats.lastOplogAt.get()) | |
.strongReference(true) | |
.register(Metrics.globalRegistry); |
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
Gauge.builder("sync.last.seen.doc.at", this, listener -> listener.lastSeenAt.get()) | |
.strongReference(true) | |
.register(Metrics.globalRegistry); | |
Gauge.builder("sync.last.processed.doc.at", this, listener -> listener.lastProcessedAt.get()) | |
.strongReference(true) | |
.register(Metrics.globalRegistry); |
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
max_over_time(sync_last_seen_oplog_at[24h]) - ignoring(instance, job) max_over_time(sync_last_seen_doc_at[24h]) |
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
max_over_time(sync_last_processed_doc_at[24h]) - max_over_time(sync_last_seen_doc_at[24h]) |
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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.4.22 <0.9.0; | |
contract SampleContract { | |
uint storedData; | |
function set(uint x) public { | |
storedData = x; | |
} |
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
const SampleContract = artifacts.require("SampleContract"); | |
contract("SampleContract", function (accounts) { | |
it("...should store the value 89.", async function () { | |
const simpleStorageInstance = await SampleContract.deployed(); | |
// Set value of 89 | |
await simpleStorageInstance.set(89, {from: accounts[1]}); | |
// Get stored value |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"lib": ["ES2018", "DOM"], | |
"module": "CommonJS", | |
"moduleResolution": "node", | |
"strict": true, | |
"target": "ES2018", | |
"sourceMap": true, | |
"esModuleInterop": true | |
} |
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
import React, {useEffect, useState} from "react"; | |
import "./App.css"; | |
import Web3 from "web3"; | |
import SampleContractCompiled from "backend/build/contracts/SampleContract.json"; | |
import {SampleContract} from "backend/types/web3-v1-contracts/SampleContract"; | |
import {AbiItem} from "web3-utils"; | |
function App() { | |
const [storageValue, setStorageValue] = useState(null as string | null); |
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
import { | |
Directive, | |
Input, | |
OnDestroy, | |
OnInit, | |
TemplateRef, | |
ViewContainerRef, | |
} from '@angular/core'; | |
import { Store } from '@ngrx/store'; | |
import { User } from './user'; |