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 main | |
import ( | |
"fmt" | |
"math/rand" | |
"net/http" | |
_ "net/http/pprof" | |
"runtime" | |
"time" | |
) |
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 main | |
import ( | |
"flag" | |
"fmt" | |
"math/rand" | |
"net/http" | |
_ "net/http/pprof" | |
"os" | |
"runtime" |
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
#!/usr/bin/env node | |
"use strict"; | |
const interval = 1000; // 采样间隔,即在这个间隔的自然时间内,调用lag()得到的结果将只会得到同样的返回 | |
const lag = require('event-loop-lag')(interval); | |
function consume() { | |
function fabonacci(n) { | |
if (n === 0) { | |
return 0; |
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
import { Entity, Column, PrimaryGeneratedColumn, Index, BaseEntity } from 'typeorm'; | |
@Entity('test_entity') | |
@Index('test_entity_index', ['columnB', 'columnC'], { unique: true }) | |
export class TestEntity extends BaseEntity { | |
@PrimaryGeneratedColumn({ type: 'int', name: 'id' }) | |
id: number; | |
@Column({ type: 'int', name: 'column_b' }) | |
columnB: number; |
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
Statistical profiling result from isolate-0x103000000-v8.log, (20819 ticks, 582 unaccounted, 0 excluded). | |
[Shared libraries]: | |
ticks total nonlib name | |
38 0.2% /usr/lib/system/libsystem_malloc.dylib | |
22 0.1% /usr/lib/system/libsystem_kernel.dylib | |
9 0.0% /usr/lib/system/libsystem_platform.dylib | |
4 0.0% /usr/lib/system/libsystem_c.dylib | |
1 0.0% /usr/lib/system/libsystem_pthread.dylib |
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
{ | |
"name": "profile", | |
"version": "0.0.1", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "MIT", |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "book/book.proto", | |
"version": "version not set" | |
}, | |
"schemes": [ | |
"http", | |
"https" | |
], |
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
syntax = "proto3"; | |
package com.book; | |
message Book { | |
int64 isbn = 1; | |
string title = 2; | |
string author = 3; | |
} |
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: com.book | |
// file: book/book.proto | |
import * as grpc from "grpc"; | |
import * as book_book_pb from "../book/book_pb"; | |
interface IBookServiceService extends grpc.IMethodsMap { | |
getBook: IGetBook; | |
getBooksViaAuthor: IGetBooksViaAuthor; | |
getGreatestBook: IGetGreatestBook; |
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
import * as $protobuf from "protobufjs"; | |
/** Namespace com. */ | |
export namespace com { | |
/** Namespace book. */ | |
namespace book { | |
/** Properties of a Book. */ | |
interface IBook { |
NewerOlder