Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add dc and worker ids to ostrich

  • Loading branch information...
commit c014ba93096010691468103e17e1d1f517d4522b 1 parent e121e3e
@ryanking ryanking authored
View
3  src/main/scala/com/twitter/service/snowflake/SnowflakeServer.scala
@@ -17,6 +17,7 @@ import org.apache.zookeeper.{KeeperException, CreateMode, Watcher, WatchedEvent}
import org.apache.zookeeper.KeeperException.NodeExistsException
import scala.collection.mutable
import java.net.InetAddress
+import com.twitter.ostrich.Stats
case class Peer(hostname: String, port: Int)
@@ -34,6 +35,8 @@ object SnowflakeServer {
new ZooKeeperClient(zkHostlist)
}
+ Stats.makeGauge("datacenter_id") { datacenterId }
+ Stats.makeGauge("worker_id") { workerId }
def shutdown(): Unit = {
if (server != null) {
log.info("Shutting down.")
Please sign in to comment.
Something went wrong with that request. Please try again.